Search Results

Search: Posts Made By: srilaxmi
3,133
Posted By srilaxmi
Explain SED code
Hi,

Can anyone pls explain me the below SED code in detail.


sed -e :a -e '$!N;s/\n//;ta' -e P -e D


When this code is executed with a file(has 1lac records), it is taking very long time...
1,973
Posted By srilaxmi
Scrollbar in email
Hi,

I am sending a text file through email as email-body. This file is having records which have width more than a page.
When i recieve the email, i can see no scrollbar in the email. So its not...
4,141
Posted By srilaxmi
How to know the user who moved the files to other dir
Hi,

I want to know the user ID who moved a file from one directory to another Directory.

Example: File1 created by user A is present in dirA
then some one has moved it to dirB using "mv"...
2,730
Posted By srilaxmi
remove newline chars in each record of file
Hi,

I have a fixed width file with record length 10.
I need to remove multiple newline characters present in each record.

EX:
af\n72/7\n
s\n3\nad\n
2\n\n33r\n
In the above file I want...
17,350
Posted By srilaxmi
Deciaml Output using bc
Hi,

when I try to do echo 'scale=3; $a / 1000' | bc
here a=1500

This giving error as "syntax error on line 1 stdin"


why iam getting this error?


Thanks,
Sri
8,606
Posted By srilaxmi
Thanks
Thanks danmero ... its working fine now.. !
8,606
Posted By srilaxmi
summing up the fields in fixed width file
Hi,

I have a fixed width file with some records as given below:

" 1000Nalsdjflj243324jljlj"
"-0300Njfowjljl309933fsf"
" 0010Njsfsjklj342344fsl"

I want to sum-up first field values(i.e from...
18,655
Posted By srilaxmi
thanks
Thanks all,

Goldorakk, your solution is working fine.

Can you please explain the code. I am unable to understand this.


Thanks,
Sri
18,655
Posted By srilaxmi
Hi, Thanks for your quick reply, but im...
Hi,

Thanks for your quick reply,

but im getting output as below using SED.

a bsa df32323
sf saafs sdf4333
a b cadfsa dsf23-3223

and using "tr" iam able to delete extra spaces but...
18,655
Posted By srilaxmi
remove extra spaces between fields
Hi,

I have a source file as mentioned below: I want to remove all the extra spaces between the fields.

a b--------|sa df-------|3232---|3
sf sa------|afs sdf-----|43-----|33
a b c------|adfsa...
1,642
Posted By srilaxmi
Please explain the stmt
hi,

Please explain the below stmt.

P=1234
var1=:/a/b/c/file.dat

printf "%s %s\n" "$" "${var1#?}"


Output is:
1234 /a/b/c/file.dat

What is #? in printf stmt? by using that the...
12,322
Posted By srilaxmi
Replace line number 2 with another line
Hi,

How can i replace second Line of a file with another line. The whole 2nd line should be replaced with new line.

Please let me know the solution.


Thanks,
Sri
2,019
Posted By srilaxmi
explain the code
Hi ,

Can anyone explains what does the below highlighted statements means:

# Set environment variables
. ${0%/*}/wrkenv.sh
jobName_sh=${0##*/}
jobName=${jobName_sh%.*}



Thanks,
Sri
10,046
Posted By srilaxmi
creating a file in reverse order of another file
Hi,

I have a requirement where i need to write a script to create the new file from the given input file with the data in reverse order (bottom to top)
Sample data:
Input File--------------...
12,909
Posted By srilaxmi
Timestamp to date conversion in ksh
Hi,

I have a file containing timestamp( Example given below). How can i get date(mmd-dd-yyyy) from it?

($> cat file1.txt
2008-11-24 05:17:00.7043)


Thanks,
Sri
16,565
Posted By srilaxmi
I think we can do it this way: x=`echo $var...
I think we can do it this way:

x=`echo $var | cut -d" " -f1`
y=`echo $var | cut -d" " -f2`

Please let me know if we can do it in another way?
Thanks,
Sri
16,565
Posted By srilaxmi
split a variable into two
Hi,

I have a variable with the value "hello world". I want to split this variable into two, so that i can write "hello" into one variable and "world" into another.

Any idea how to do this?
...
172,675
Posted By srilaxmi
echo without newline character
hi,

I have a for loop where in I write some file name to another file.
I want to write all the filenames to another without any newlines. how can i avoid getting new lines with echo?

Thanks,...
7,027
Posted By srilaxmi
Thanks all !!! with Double quotes, its...
Thanks all !!!

with Double quotes, its working fine.
7,027
Posted By srilaxmi
read records from a file
Hi all,

I have a requirement where I need to read records one by one from a file. I have tried this below code:

while read mLine
do
echo 'Line = '${mLine}
done < input_file


--- But...
14,562
Posted By srilaxmi
how to send mail in UNIX using MIME
Hi,

I am searching for an option to send mail with multiple attachments using unix. I know uuencode option, but I dont have the executable in our machines. So I am looking for some other option to...
5,476
Posted By srilaxmi
use of RUNCMD
Hi,

I want to know the use of RUNCMD.
I have a script and in that this RUNCMD used as

"export RUNCMD=${RUNCMD-cobrun}"
echo $RUNCMD

Can anyone please explain me, how the above statement...
Showing results 1 to 22 of 22

 
All times are GMT -4. The time now is 07:16 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy