필터 지우기
필터 지우기

Delimiter at particular column

조회 수: 1 (최근 30일)
Muhammad
Muhammad 2013년 9월 18일
Hey
I am getting problem to apply delimiter at particular column. My text file consists of delimited data but I want to use delimited tool only on particular column.
  • for e.g. 03:30:45 in 1st column and Cellid:dBm in 2nd column. I want to apply delimiter : only at column 2.
Is there any way? Your respected opinions are appreciated.
  댓글 수: 4
Jan
Jan 2013년 9월 18일
What does "when I am using delimiter" exactly mean? Please post the code you are talking of. How can a delimiter "applied" during the import?
The example looks strange:
Time; NID01: dBm;
16:56:12; 53172; -89;
When these are two columns, why do the 2nd line looks like 3 values?
Posting the code you use, a clear small example for the input and a definition of the output in valid Matlab syntax would stop the discussion and allow for a fast solution of your problem.
Muhammad
Muhammad 2013년 9월 19일
Please find the attached file. I am using Matlab R2012b. I am importing my file and applying delimiter on the attached imported file. How could I apply delimiter on particular column using column delimiters option.

댓글을 달려면 로그인하십시오.

답변 (1개)

Azzi Abdelmalek
Azzi Abdelmalek 2013년 9월 18일
편집: Azzi Abdelmalek 2013년 9월 18일
Read all your data with delimiter then recreate the first column.
If
A{1}={'03';'03';'03'}
A{2}={'30';'30';'30'}
A{3}={'45';'46';'47'}
Then
first_column=cellfun(@(x,y,z) [x,':',y,':',z],A{1},A{2},A{3},'un',0)
  댓글 수: 6
Muhammad
Muhammad 2013년 9월 19일
Thanks for your reply.
Please find the attached file. I am using Matlab R2012b. I am importing my file and applying delimiter on the attached imported file. How could I apply delimiter on particular column using column delimiters option.
Jan
Jan 2013년 9월 19일
I do not see any attached file.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Whos에 대해 자세히 알아보기

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by