![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Reading a binary file in text or ASCII format | Nagendra | High Level Programming | 3 | 12-03-2008 06:11 PM |
| Help with reading text file | bilal05 | UNIX for Dummies Questions & Answers | 1 | 04-12-2008 03:46 PM |
| Reading from Text file..... | user__user3110 | Shell Programming and Scripting | 0 | 04-11-2008 05:18 AM |
| Reading text from a file | LiquidChild | Shell Programming and Scripting | 12 | 05-30-2007 08:38 AM |
| reading text file | jaan | Shell Programming and Scripting | 1 | 02-16-2004 08:43 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Hello,
I am having a tough time reading data from an input text file. The input file has lines of data which is comma seperated. Each line represents a record/row, but unfortunately the data in the individual column/fields have spaces and `cat filename`is not returning entire line ( to read individual records). How can I read individual records from this file? Is there a way to do it? Below is a sample of the input file and it is also attached with this post. Content Type,Author,Initial Submit Date,Task Name,Task Start Date,Task End Date,Task Owner,Completion Date Workflow Properties,wcm_master,,,Workflow Properties,Workflow Properties,Workflow Properties,Workflow Properties Workflow Properties,wcm_master,,,Workflow Properties,Workflow Properties,Workflow Properties,Workflow Properties Workflow Properties,wcm_master,1217361943,TaskAddFile,Workflow Properties,Workflow Properties,Workflow Properties,Workflow Properties Workflow Properties,wcm_master,1217362058,TaskAddFile,Workflow Properties,Workflow Properties,Workflow Properties,Workflow Properties Email Test Flow,wcm_master,1217971876,TaskAddFile,Email Test Flow,Email Test Flow,Email Test Flow,Email Test Flow CGI Test,n1plomen,1219776115,TaskAddFile,CGI Test,CGI Test,CGI Test,CGI Test CGI Test,n1plomen,1219776268,TaskAddFile,CGI Test,CGI Test,CGI Test,CGI Test CGI Test,n1plomen,1219776333,TaskAddFile,CGI Test,CGI Test,CGI Test,CGI Test CGI Test,n1plomen,1219776417,TaskAddFile,CGI Test,CGI Test,CGI Test,CGI Test CGI Test,n1plomen,1219776470,TaskAddFile,CGI Test,CGI Test,CGI Test,CGI Test CGI Test,n1plomen,1219787503,TaskAddFile,CGI Test,CGI Test,CGI Test,CGI Test CGI Test,n1plomen,1219787605,TaskAddFile,CGI Test,CGI Test,CGI Test,CGI Test Email Test Flow,wcm_author,1219865848,TaskAddFile,Email Test Flow,Email Test Flow,Email Test Flow,Email Test Flow Email Test Flow,wcm_author,1219865871,TaskAddFile,Email Test Flow,Email Test Flow,Email Test Flow,Email Test Flow Email Test Flow,wcm_author,1219865908,TaskAddFile,Email Test Flow,Email Test Flow,Email Test Flow,Email Test Flow Your help is highly appreciated! Thank you, Ajay |
|
|||||
|
Can you use something like the following?
Code:
while read zf do cont_type=$(echo "$zf" | cut -d"," -f1) echo "Content Type ="$cont_type author=$(echo "$zf" | cut -d"," -f2) echo "Author ="$author done <input_file |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|