Shell script to read lines in a text file and filter user data Shell Programming and Scripting

Thread Tools Search this Thread
# 1  
Old 03-24-2014
Shell script to read lines in a text file and filter user data Shell Programming and Scripting


Last edited by VikrantD; 03-25-2014 at 03:35 AM..
# 3  
Old 03-25-2014
Sir, i tried as following way ..
    declare -a arr
    while read line
    varray=(`echo $line | awk '{ split($0, ulist, "|"); for(i=1; i<=11; i++) printf ulist[i] " "; }'`)
    echo "Array Length: " ${#varray[@]}

buts its not working
actually i m very beginner for shell scripting
still i m trying my best
Moderator's Comments:
Mod Comment select text first before pushing the code tags button

Last edited by Scrutinizer; 03-25-2014 at 01:51 AM..
# 4  
Old 03-25-2014
I am not seeing any relationship between the sample data, the desired output, or sample.txt included in the 1st message in this thread and the shell script shown in the 3rd message in this thread.

I was expecting the sample data shown in the 1st message and the data in sample.txt attached to the 1st message to be the same (or at least similar), but they aren't. I don't see any obvious relationship between the desired output and the sample input or sample.txt data.

Please give us an English description of what the format is for the input data. Then explain why the count shown in the first line does not exactly match the number of characters in the following lines, why some groups start with ength-<number>] while others start with Length-<number>], what determines what should be printed in the 1st two fields of the output, and what determines how much of the text from the input should be copied into the 3rd field in the output.

Thread Tools Search this Thread
Search this Thread:
Advanced Search

More UNIX and Linux Forum Topics You Might Find Helpful
How to get the shell script to read the .txt file as an input/data? Gurdza32 Shell Programming and Scripting 11 05-05-2017 04:12 AM
Read csv file, convert the data and make one text file in UNIX shell scripting RJG Shell Programming and Scripting 6 11-02-2016 08:48 AM
Shell - Read a text file with two words and extract data dandaryll UNIX for Beginners Questions & Answers 5 10-14-2016 09:37 AM
Delete all CONSECUTIVE text lines from file shell scripting RJSKR28 Shell Programming and Scripting 5 07-21-2016 09:43 AM
Need help on inserting data from text file to excel using shell script suman.frnz Shell Programming and Scripting 3 04-24-2013 02:19 AM
How to create a shell script to read a foldername from a text file and go to the folder? pm1504 Shell Programming and Scripting 7 01-28-2013 01:10 AM
Read data from .csv file through shell script & modify raj100 Shell Programming and Scripting 3 03-21-2011 08:32 AM
How to read the data from the text file in shell script? dineshmurs Shell Programming and Scripting 2 04-13-2010 02:41 PM
Filter data in Excel sheet using Shell Script bhanusri83 Shell Programming and Scripting 8 12-14-2009 09:48 PM
Shell script to read lines in a text file and filter user data srimal Shell Programming and Scripting 4 10-23-2009 01:35 AM
Using Shell Script to get data from text file jermaine4ever Shell Programming and Scripting 1 03-13-2009 08:58 PM
shell script to read data from text file and to load it into a table in TOAD pallavishetty Shell Programming and Scripting 1 10-31-2008 04:15 AM
Post Shell programming: Question about source a file and read data from the file ccwq Shell Programming and Scripting 3 08-04-2007 10:28 PM
Shell Script to read specific lines in a file varshanswamy Shell Programming and Scripting 5 08-22-2005 07:12 PM
To Read a text file using shell Programming sandytul UNIX for Dummies Questions & Answers 1 04-11-2001 11:15 AM