10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
In a SCO Unix shop, I am working on the following script to move any file to its same location on the target machine (called 'othersy' here):
pwd=`pwd`
for i in "$@"
do
echo " $i "
if ; then echo 1; else echo 0; fi
rcp -p $i othersy:$pwd/$i
echo "Finished with ^ If I find a file... (4 Replies)
Discussion started by: wbport
4 Replies
2. Shell Programming and Scripting
Hi,I've a unix pipe delimited file as below f1|f2|f3|f4|f5|f6 My requirement is to pad spaces on the left to fields f2, f3 and f5. Field Lengths according to file layout f2 - 4 char f3 - 5 char f5 - 3 char If my record is as below 1|43|bc|h0|34|a Output record should be as below 1| 43| bc|h0|... (4 Replies)
Discussion started by: Soujanya_K
4 Replies
3. Shell Programming and Scripting
I'm using cygwin bash to submit scheduled tasks (kinda like cron jobs) in windows and the following script is giving me grief. I need to format the current time with leading zeros before 10AM for the hour field. In this example, I manually typed in "09:50" instead of using the `printf...`... (2 Replies)
Discussion started by: siegfried
2 Replies
4. Shell Programming and Scripting
I have the following script that renames filenames like:
blah_bleh_91_2011-09-26_00.05.43AM.xls
and transforms it in:
91_20110926_000543_3_blih.xls
for a in *.xls;
do
b="$(echo "${a}" | cut -d '_' -f4)"
dia=`echo ${b} | cut -c9-10`
mes=`echo ${b} | cut -c6-7`
anio=`echo ${b} | cut -c1-4`... (4 Replies)
Discussion started by: Tr0cken
4 Replies
5. Shell Programming and Scripting
removing leading zeros for a decimal column in a file which has string & decimal values
,,,,,6630140,XXXXXXXXXXXXXXX, 0020.00,USA
,,,,,6630150,XXXXXXXXXXXXXXXL (xyz, 0010.00,USA
,,,,,6630150,XXXXXXXXXXXXXXX(xyz), 1300.00,USA
My file contains 9 columns. Out 9 columns, 8th column contains the... (9 Replies)
Discussion started by: marpadga18
9 Replies
6. Shell Programming and Scripting
I'm sure this is easy to do but I can't find a one line command with awk or sed to append a char to the end of the string from Nth column.
Any sugestion please?
Thanks (2 Replies)
Discussion started by: cabrao
2 Replies
7. Shell Programming and Scripting
I was wondering someone might be able to push me in the right direction, I am writing a script to modify fixed-width spool files, As you can see below the original spool file broke a single line into two for printability sake.
I have had been able do the joins using sed, the thing I am... (10 Replies)
Discussion started by: Cho Nagurai
10 Replies
8. Shell Programming and Scripting
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 column trim the leading zero's for that column values and write back to the same file in the same... (7 Replies)
Discussion started by: nvuradi
7 Replies
9. UNIX for Dummies Questions & Answers
I would like to know how to trim leading zero only in certain column of of a string, example:
hdhshdhdhd000012mmmm0002abc <===== before
hdhshdhdhd 12mmmm 2abc <===== after
Thanks for your help. (2 Replies)
Discussion started by: dngo
2 Replies
10. Shell Programming and Scripting
I have a file called clientname_filename.csv
whose contents are like
col1|col2|col3|col4|
510|abc|xxx|450|
510|abc11|yyy|350
510|pqr99|zzz| 670
512|222|439|110
Here i have check the contents of column for data type.
i have a constraints that col1 always contain Numeric value column 2... (12 Replies)
Discussion started by: jambesh
12 Replies