OK, let's set this up. I have a tab delimited file from excel. In my UNIX shell I have the following lines
This works fine if there is something in every column like this. NOTE, those are tabs, not spaces.
LINE_NO=17
SKIP=SKIP
IGNORE_ERRORS=FALSE
OTHER=Endofline
The problem comes about if one of the columns is a null like this.
LINE_NO=17
SKIP=FALSE
IGNORE_ERRORS=Endofline
OTHER=
How do I get unix to see that double tab? I am on an AIX box running a ksh shell.
Hmm... I had a look at an AIX box (not my usual area) and the ksh man page is a bit of a waste of time, isn't it!
Going back to a HP-UX box, it says:
So it seems like you're out of luck with that particular method. Have you considered using awk or perl or is there lots of other shell code already written that depends on this part?
After experimenting a little, it seems to behave differently if you use a non-whitespace character as your IFS. So if you run your input data through sed and convert all of the separators to, say, ":", then it does appear to work as you'd expect.
Hi, I have a rquirement in unix as below .
I have a text file with me seperated by | symbol and i need to generate a excel file through unix commands/script so that each value will go to each column.
ex:
Input Text file:
1|A|apple
2|B|bottle
excel file to be generated as output as... (9 Replies)
Hi Experts,
I have a tab deliminated file as below
myfile.txt
Local Group Memberships *Administrators *Guests
I need data in below format starting from 4th position.
myfile1.txt
Administrators Guests
the above one is just an example and there could... (15 Replies)
Hi How to make tab delimited file to space delimited?
in put file:
ABC kgy
jkh ghj
ash kjl
o/p file:
ABC kgy
jkh ghj
ash kjl
Use code tags, thanks. (1 Reply)
1. The problem statement, all variables and given/known data:
Hello!
I need help with this problem bash shell scripting that basically just reads the data in a tab delimited file and does the following below
1. Read in the data file Survey.txt and assign the column values to variables of... (6 Replies)
I have a file which was pipe delimited, I need to make it tab delimited. I tried with sed but no use
cat file | sed 's/|//t/g'
The above command substituted "/t" not tab in the place of pipe.
Sample file:
abc|123|2012-01-30|2012-04-28|xyz
have to convert to:
abc 123... (6 Replies)
Hi Forum
I have a tab delimited file that opens well in Openoffice calc (excel). But when I perform any operation in command line, it reads the file incorrectly. When I 'save As' the same file in office as tab delimited then it works fine.
The file that I think is tab delimited is actually... (8 Replies)
Hi all,
I have a file with single white space delimited values, I want to convert them to a tab delimited file.
I tried sed, tr ... but nothing is working.
Thanks,
Rajeevan D (16 Replies)
Hi there
Just wondered if someone could help me out
I have a file that has been delimited by tabs, ie
field1<tab>fiield2<tab>field3
Does anybody know a command that will convert tabs to commas throughout the entire file?
Note: there are a number of unpopulated fields in the file so... (6 Replies)