![]() |
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 |
| very first shell program. | bebop1111116 | Shell Programming and Scripting | 3 | 09-17-2006 09:03 PM |
| shell program | jyotiardeshana | Shell Programming and Scripting | 4 | 01-03-2006 06:51 AM |
| shell program | rameshparsa | Shell Programming and Scripting | 1 | 11-17-2005 01:18 PM |
| C shell Program | Reza Nazarian | Shell Programming and Scripting | 2 | 07-28-2003 02:52 PM |
| shell program | nageshrc | UNIX for Advanced & Expert Users | 2 | 11-27-2001 12:32 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
shell program
Iam having file 1 as
wc -l file1 is 8 Code:
QWEERTYUU|7927836357398398398913 yuyuyu uyiuyuyuyuy yuiyuiyuyuyy FDHGFSHAJK|1476887897877777777771 iopwiiwpoi e . . . . so iam using the command as tail -n 8 file1| read srec echo "$rec" now (echo "$rec" )iam getting the out file with the compressed data(without spaces as in file1) so how i can the output file having same line as in file1 |
|
||||
|
The above file1 in my previous post is only sample record and the file will have records in lacs.
EX Code:
DWERWDSF6672843829890028 LEEBA@fHEC_com 2008-02-030000023.90 0009976 00015.00 2008-03-02LEE,JIN UNICOL 000000000000012.21 000000000000000.00 CBB0000 |
|
||||
|
The code i have mesioned above is sample( one line in large file.). like that lacks of lines in a large file.
Iam using the following function. Code:
read_file1()
{
if [ $vcount -ne 0 ]
then
tail -n $vcount file1.txt| read vrec
vacct=`echo $vrec | cut -c 9-24`
vform=`echo $vrec | cut -c 1-8`
vcount=$((vcount-1))
else
vcount=-1
fi
}
tHE ABOVE file1, that i have given is not correct. and here is the first line in file1 file1 Code:
ASDWERTS09876500000224208 tlee@URID_com 2008 02-030000023.90 0009976 00015.00 2008-03-02LEE,ASKIMODERN TERENCE 000000000000012.21 000000000000000.00 CBB0 Here iam using read_file1 function to do some calculations in my project. so iam taking 1st line in vrec variable in the above function. when writing this vrec to an outputfile. iam getting the file1 1st line having no exact spaces. pls give suggesions.?? |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|