![]() |
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 |
| Adding specific text and spaces to each line in a text file | hertingm | Shell Programming and Scripting | 4 | 08-25-2008 02:34 PM |
| extracting unique lines from text file | soliberus | Shell Programming and Scripting | 3 | 08-22-2008 10:18 AM |
| extracting a set of strings from a text file | Deanne | Shell Programming and Scripting | 2 | 09-20-2007 11:31 PM |
| Extracting data from text file based on configuration set in config file | suparnbector | Shell Programming and Scripting | 3 | 08-10-2007 02:25 AM |
| Extracting specified line from a file using awk | sirtrancealot | Shell Programming and Scripting | 3 | 07-15-2006 02:09 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Extracting a line in a text file
If my file looks like this….
10 20 30 and I want to take each line individually and put it in a variable so it can be read later in it's on individual test statement, how can I do that? I guess what I'm asking is how can I extract each line individually. Thanks Last edited by terryporter51; 10-10-2008 at 05:31 PM.. |
|
||||
|
I'm still having trouble stripping each line out so I can put it in it's on variable or text file.
i.e. I want 10 to be in a text file or set to a variable alone 20 set to be in a text file alone or in it's on variable and 30 set to be in a text file or set to it's on variable. I really want the position of the number because the number will change depending on the number of full tapes. Sorry guy's if this sound elementary all I want to do is grab which ever line I want 1-3 on call to my discretion. Thx |
|
||||
|
Something like that:
Code:
eval $(awk '{print "line"NR"="$0}' file)
echo $line1
....
|
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|