Computing.Net > Forums > Unix > unix spliting error

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

unix spliting error

Reply to Message Icon

Name: dprakash
Date: January 21, 2009 at 07:20:30 Pacific
OS: DF
CPU/Ram: DF
Product: Dfd / Dfdf
Subcategory: General
Comment:

hi all

i have used a script to split a rows into columns like below:
file a

100|22,43,56
101|24,43

into
file b

100,22
100,43
100,56
101,24
101,43

the above is an example...... like this we have some 10000 records in a file..

what the error im getting is that..

im getting some unknown records after splitting.. means some extra records..

like

100,22
100,43
100,56
101,24
101,43
101,67
101,88 where 67 and 88 are not a part of file a....

can any body plz help me regarding this...??
i have used below script to split a file:

#!/bin/kshi=2while IFS="|" read col1 col2do # parse column 2 by commas set - $(IFS=","; echo ${col2}) i=1 while (($i <= $#)) do printf "%d,%s\n" $col1 $(eval echo \"\$${i}\") ((i+=1)) donedone < datafile

thanks



Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: unix spliting error

unix install error cphi failed: ah = 15 www.computing.net/answers/unix/unix-install-error-cphi-failed-ah-15/2973.html

Unix Script Error, Quel Strange www.computing.net/answers/unix/unix-script-error-quel-strange/5244.html

SCO UNIX & TCP ERROR www.computing.net/answers/unix/sco-unix-amp-tcp-error/381.html