Search Results

Search: Posts Made By: nvuradi
2,863
Posted By nvuradi
Remove last few characters in a file but keeping Header and trailer intact
Hi All,

I am trying write a simple command using AWK and SED to this but without any success.

Here is what I am using:

head -1 test1.txt>test2.txt|sed '1d;$d' test1.txt|awk '{print...
5,551
Posted By nvuradi
sorry for the wrong file Input file: ColA...
sorry for the wrong file
Input file:
ColA ColB
1|2
2|x
3|y
4|c
5|q

and it doesnt have column header.

thanks johnson for the approach, but it will try to read the file line by...
5,551
Posted By nvuradi
Converting Column values to comma delimted single Row
I have a requirement in which i have to read a file which has multiple columns seperated by a pipe "|" from this i have to read each column values seperately and create a comma seperated row for the...
4,535
Posted By nvuradi
Thank you all for the responses!!! I am...
Thank you all for the responses!!!

I am using the following query

var1=$( printf ":%s" "$DIR/${FILE_NAME}"* )
printf "%s\n" "${var1#?}" >> "$DIR/$filename_out.txt"



Thanks,
Narendar
4,535
Posted By nvuradi
for the heck...i want the output to be in the...
for the heck...i want the output to be in the form
DIR/filename: DIR/filename2: DIR/filename3: DIR/filename4..so on to be added to the output file.

[space between : and DIR is not required but...
4,535
Posted By nvuradi
this will add the files matching the patter to...
this will add the files matching the patter to the file_out..

but i want them to concatenated using ":" and added.
4,535
Posted By nvuradi
concatenating the filenames in a directory
hi all,

I have a requirement where in i have to read all the filenames based on a pattern from a directory and concatenate all these file names and write it to another file.


i am using the...
5,491
Posted By nvuradi
thank you for the response!!... but i have to...
thank you for the response!!...
but i have to write the data to another file which might add up to
some more time.

also any idea on how to redirect the output of the awk to another
file?? ...
5,491
Posted By nvuradi
Prefix a string to the contents of a file
Hi all,

I have a requirement where in i have to create a temporary file by prefixing a string of special characters to each row of a input file.


the input file is '|' delimited.

here is...
9,431
Posted By nvuradi
Hi all thanks for the response. I am using the...
Hi all thanks for the response.
I am using the following to achieve it,
"Amount=`awk 'FNR==3 {sum+=$3} END {print sum} ' file pattern`"

it is getting the sum from all the files with given...
9,431
Posted By nvuradi
Yes, somehow i missed it..thanks for the help. ...
Yes, somehow i missed it..thanks for the help.

Thanks,
Narendar
9,431
Posted By nvuradi
how do we specify the delimiter here...from the...
how do we specify the delimiter here...from the code above i can make out that Space has been assumed to be the delimiter..

but if i have something other than space than how do i modify it??
9,431
Posted By nvuradi
one thing is number of files are not fixed and...
one thing is number of files are not fixed and the 3rd line contains text as
"Total amount = 8792187481274"

i need to read the number part and sum it for all the files based on the pattern...
9,431
Posted By nvuradi
Read the data from multiple files and sum the value
Hi all,

I have a requirement where i have to read multiple files using Shell Script in Korn Shell.

each file will have the 3rd line as the amount field, i have to read this amount field and sum...
14,848
Posted By nvuradi
How to get the Previous month in Korn Shell
Hi I have a requirement where i have to append the prev month (e.g Feb for current date ) to the file name before sending it for some other processing.

if input file name is
xyz.txt output for...
2,061
Posted By nvuradi
Shell script is taking more than 3 hrs to execute
Hi



I am doing a process of converting all the values of key column into a row, for eg



Key col1 col2

1 1 1

1 ...
1,886
Posted By nvuradi
removing a delimiter at the start of row
I Have this code



while [ ${iCount1} -le ${reccount} ]

do

column1=":`cat /home/test_inter.txt|head -${iCount1}|tail -1|cut -d "," -f2`"

columnA=$columnA$column1

iCount1=`expr...
1,860
Posted By nvuradi
Help needed in Shell Script
Hi



I have the following columns in my input file which is sorted on ColA



colA colB colC colD colE



The data is such that for a single colA it can have...
7,984
Posted By nvuradi
yeah its printing the contents ..but i want to...
yeah its printing the contents ..but i want to write it to same file....
7,984
Posted By nvuradi
hi i am getting the following error when i used...
hi i am getting the following error when i used the awk command

awk 'BEGIN{FS=OFS="|"}{$NF=$NF+0} 1' $filename
Error:
awk: syntax error near line 1
awk: bailing out near line 1


if...
7,984
Posted By nvuradi
truncating leading zeros of a column in a file
Hi

I have a file in which I have 5 columns which are delimited by “|” as shown

ABC|12|YAK|METRIC|000000019.5

XYZ|10|ABX|META|000000002.5





Now my requirement is to take the last...
18,827
Posted By nvuradi
Thanks zazzybob..its workin
Thanks zazzybob..its workin
18,827
Posted By nvuradi
running multiple scripts
Hi all I have a requirement where I have a flow like

Script1
script2 Script3 Script 4 Script 5 Script 6 ...
3,111
Posted By nvuradi
Archiving and moving the files
hi all i have a requirement where in i have to zip all the files with "*.bkp" after 14 days and move the zip files to Archive directory ....
i am able to achieve the first functionality but not able...
Showing results 1 to 24 of 24

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