Sponsored Content
Top Forums Shell Programming and Scripting Copy respective path next to last column with awk Post 302494886 by cgkmal on Tuesday 8th of February 2011 06:45:27 PM
Old 02-08-2011
Copy respective path next to last column with awk

Hi to all,

I have the short print out sample of the DOS command "dir S/" as showed below.


Code:
 Directory of C:\Program Files\Winamp\Skins\Bento\window

02/12/2010  11:35 p.m.    <DIR>          .
02/12/2010  11:35 p.m.    <DIR>          ..
11/12/2009  10:31 a.m.            13,556 aol_radio_alb_art.jpg
28/04/2009  02:20 p.m.            12,206 config.png
28/04/2009  02:20 p.m.            13,950 controls.png
28/04/2009  02:20 p.m.             2,858 menu_file.png
               4 files            42,570 bytes free
               
 Directory of C:\Program Files\Windows Photo Viewer

14/07/2009  02:48 a.m.    <DIR>          .
14/07/2009  02:48 a.m.    <DIR>          ..
13/07/2009  07:17 p.m.            92,936 ImagingDevices.exe
13/07/2009  07:15 p.m.         1,853,440 ImagingEngine.dll
               2 files         1,946,376 bytes free

Iīve done some custom manipulations with the columns format using sed, but donīt know how to
copy to the rigth (as last column)the respective path above of every block of files as follow.


Code:
 Directory of C:\Program Files\Winamp\Skins\Bento\window

02/12/2010  11:35 p.m.    <DIR>          .
02/12/2010  11:35 p.m.    <DIR>          ..
11/12/2009  10:31 a.m.            13,556 aol_radio_alb_art.jpg  C:\Program Files\Winamp\Skins\Bento\window
28/04/2009  02:20 p.m.            12,206 config.png  C:\Program Files\Winamp\Skins\Bento\window
28/04/2009  02:20 p.m.            13,950 controls.png  C:\Program Files\Winamp\Skins\Bento\window
28/04/2009  02:20 p.m.             2,858 menu_file.png  C:\Program Files\Winamp\Skins\Bento\window
               4 files            42,570 bytes free

 Directory of C:\Program Files\Windows Photo Viewer

14/07/2009  02:48 a.m.    <DIR>          .
14/07/2009  02:48 a.m.    <DIR>          ..
13/07/2009  07:17 p.m.            92,936 ImagingDevices.exe  C:\Program Files\Windows Photo Viewer
13/07/2009  07:15 p.m.         1,853,440 ImagingEngine.dll  C:\Program Files\Windows Photo Viewer
               2 files         1,946,376 bytes free

May somebody help me with this issue?

Thanks in advance.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Copy the data column to adjacent column

Hi, i have file which contains only one record like below a|b|c|.... The no of columns is not known. The expected output is as below: a|a|b|b|c|c|... Please provide me your suggestions. OS: unix Thanks, Selva (7 Replies)
Discussion started by: bharathappriyan
7 Replies

2. Shell Programming and Scripting

Copy last modified directory from path using Perl

Hi I need to copy last modified directory from path /users/bin to be copied to /tmp in a perl script ...somehow my script is not allowing me to do cd /users/bin. i have tried $dir = `find /users/bin -maxdepth 1 -type d -mtime 0 ` cp -R $dir /tmp/new but it says missing destination... (1 Reply)
Discussion started by: shaveta
1 Replies

3. Shell Programming and Scripting

A shell script for create a a file in the respective path

Hello forum members, I have to create a out file in the current path./aaa/bbb/ccc/hhh. i am writing script below. ###script Begins##### #!/bin/ksh echo "Weclome" if then echo "Hello" rm -rf $aaa/bbb/ccc/hhh #clean the exsisting o/p file echo "no... (2 Replies)
Discussion started by: rajkumar_g
2 Replies

4. Shell Programming and Scripting

Find all .htaccess files and make a backup copy in respective directories

Hey guys, I need to know how to locate all .htaccess files on the server and make a backup of them in the folder they reside before I run a script to modify all of them. So basically taking dir1/.htaccess and copying it as dir1/.htaccess_bk dir2/.htaccess copying as dir2/.htaccess_bk... (5 Replies)
Discussion started by: boxx
5 Replies

5. UNIX for Dummies Questions & Answers

Copy column to another column in unix

Dear Gurus, I have a unix file 2 columns (# delimited) with the following data: ZTXX_CTBR1-ZBRAN1#ZTXX_CTBR1-ZBRAN_DESC# 01#CASH & CARRY# 02#DRUGSTORE - RX# 04#SUPERMARKET# 05#HYPERMARKET# 17#DRUGSTORE - NO RX# I would like to have a code that will do 2 things: 1. Delete the header... (16 Replies)
Discussion started by: chumsky
16 Replies

6. Shell Programming and Scripting

Copy column string and put in different column

Hello Here is my input: SU3902 SU3902A NS29C (10) (00) Q1J1 0 SU3902 SU3902B VLR05 (20) (02) Q2H1 4 SU3902 SU3902C NBR22 (30) (06) Q3R5 8 SU3904 SU39047 NSV19 (11) (09) Q4k6 2 SU3904 SU39048 LB231 (12) (05) Q5k1 6 SU3904 SU39049 11VLT (13) (08) Q10C1 10 SU3904 SU3904A 25R05 (15) (06)... (3 Replies)
Discussion started by: pareshkp
3 Replies

7. UNIX for Advanced & Expert Users

Copy a column to another column in UNIX fixedwidth file

Hi All, I have a fixedwidth file of length 3000. Now i want to copy a column of 4 chars i.e( length 1678-1681) to column 1127 – 1171 to the same file. Please let me know how can i achive using a single command in fixed width file. Also source column length is 4 chars and target column length... (4 Replies)
Discussion started by: kiranparsha
4 Replies

8. Shell Programming and Scripting

Copy files in respective directories

Hi Guys, I need to copy the files to respective directories based on name of the file. My script is something like below con=$1 for file in `cat $con` do file_tmp=$(ls -t1 $path| grep -i $file | head -n 1) echo $file_tmp if then cp $path$file_tmp $DIR/ap if then... (16 Replies)
Discussion started by: Master_Mind
16 Replies

9. Shell Programming and Scripting

awk copy first column in new lines

Hi all i have table like this input001_1_174 j 474536 482492 mo001_1_175 j 960192 966656 .ire 966656 984416 .uf/i want copy number of first line to other line... (10 Replies)
Discussion started by: alii
10 Replies

10. UNIX for Beginners Questions & Answers

How to copy a column of multiple files and paste into new excel file (next to column)?

I have data of an excel files as given below, file1 org1_1 1 1 2.5 100 org1_2 1 2 5.5 98 org1_3 1 3 7.2 88 file2 org2_1 1 1 2.5 100 org2_2 1 2 5.5 56 org2_3 1 3 7.2 70 I have multiple excel files as above shown. I have to copy column 1, column 4 and paste into a new excel file as... (26 Replies)
Discussion started by: dineshkumarsrk
26 Replies
Graphics::Primitive::Insets(3pm)			User Contributed Perl Documentation			  Graphics::Primitive::Insets(3pm)

NAME
Graphics::Primitive::Insets - Space between things DESCRIPTION
Graphics::Primitive::Insets represents the amount of space that surrounds something. This object can be used to represent either padding or margins (in the CSS sense, one being inside the bounding box, the other being outside) SYNOPSIS
use Graphics::Primitive::Insets; my $insets = Graphics::Primitive::Insets->new({ top => 5, bottom => 5, left => 5, right => 5 }); METHODS
Constructor new Creates a new Graphics::Primitive::Insets. Instance Methods as_array Return these insets as an array in the form of top, right, bottom and left. bottom Set/Get the inset from the bottom. equal_to Determine if these Insets are equal to another. left Set/Get the inset from the left. right Set/Get the inset from the right. top Set/Get the inset from the top. zero Sets all the insets (top, left, bottom, right) to 0. AUTHOR
Cory Watson, "<gphat@cpan.org>" SEE ALSO
perl(1) COPYRIGHT &; LICENSE Copyright 2008-2010 by Cory G Watson. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.12.3 2010-08-21 Graphics::Primitive::Insets(3pm)
All times are GMT -4. The time now is 03:53 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy