06-29-2005
text formating/Text space padding
Hi,
How do I format the following?
I have a for loop that retrieves me the path and file name of a file. In column fashion I would like to add the time and another variable containing the file's size. This will result in all the time being under each other and all the file size's being under each other. This is for logging purposes, so this will all go to file. The headings are not important.
File path variable time size
ex.
/path1/...... 10:00:00 30
/path2/.. 00:00:12 7000009
/path3/............. 12:12:31 2
Please assist.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Using a for loop I am able to get the following log file below. I would like o change the format a bit as is indicated lower down. I have looked at awk and sed but somehow is not getting any joy. I am a bit new to ksh scripting. Please assist.
This is the format of my current log file after the... (1 Reply)
Discussion started by: hugow
1 Replies
2. Forum Support Area for Unregistered Users & Account Problems
We use AIX mailx or sendmail. How can I format a text file so that lotus notes users can see diferent fonts and highlighting. Or can a gif file (company logo..) be sent along with a text file and the Lotus notes user would see the logo and text displayed at the same time and not as an attachment? (0 Replies)
Discussion started by: lidoiwo
0 Replies
3. UNIX for Dummies Questions & Answers
My little script for producing pseudo random file names works OK; but I need the file names to be formatted with zero padding, probably %05d
here's the script so far
#!/bin/bash
ls *.jpg > list
for i in `cat list`
do
rnd=$RANDOM
mv "$i" "$rnd"
done
I've been trying printf but can't... (2 Replies)
Discussion started by: platz
2 Replies
4. Shell Programming and Scripting
Dear All
I am facing problem while extracting data from below mention input file.
My op should be like this.Required field display in red in file.
Request you all to help.
OP:
RXOTX-46-5 1B4
RXOTX-46-4 2B5
INPUT FILE:
<RXMFP:MO=RXOTX-46-5;
RADIO X-CEIVER ADMINISTRATION... (4 Replies)
Discussion started by: jaydeep_sadaria
4 Replies
5. Shell Programming and Scripting
Dear all
I had input file as mention below and want op as mention.
Kindly let me knw possible ways.
Regards
Jaydeep
INPUT:
RXOTX-48-1
2A 34
2B 35
RXOTX-499-2
2C 32
RXOTX-4-1
2D 23
OUTPUT: (3 Replies)
Discussion started by: jaydeep_sadaria
3 Replies
6. Shell Programming and Scripting
Hi,
I am trying to format the output of my script in a tabular format
using the html code in my shell script.
I am using html code for the first time in a shell script.I am trying to execute this script in Ksh but it is not getting executed.
Can you please help me in figuring this out.... (6 Replies)
Discussion started by: isaacsam
6 Replies
7. Shell Programming and Scripting
Hi,
I have a fixed length text file that needs to be cut into individual files in aix and facing padding issues. If I have multiple blank spaces in the file it is just making it one while cutting the files..
Eg:-
$ - blank space
filename:file.txt
... (2 Replies)
Discussion started by: techmoris
2 Replies
8. UNIX for Dummies Questions & Answers
I have a text file with irregular spacing between values which makes it really difficult to manipulate. Is there an easy way to convert it into a space delimited text file so that all the spaces, double spaces, triple spaces, tabs between numbers are converted into spaces. The file looks like this:... (5 Replies)
Discussion started by: evelibertine
5 Replies
9. Shell Programming and Scripting
Hi Experts,
I have a text exactly like below in a file:
id item_id
item_date prin_mkt_val
--------------------------- ---------------------------
------------------------------- ------------------------
... (1 Reply)
Discussion started by: apatil65
1 Replies
10. UNIX for Dummies Questions & Answers
Hi,
I have a space delimited text file but I only want to change the first space to a tab and keep the rest of the spaces intact. How do I go about doing that? Thanks! (3 Replies)
Discussion started by: evelibertine
3 Replies
symlink(2) System Calls Manual symlink(2)
NAME
symlink - make symbolic link to a file
SYNOPSIS
DESCRIPTION
The function creates a symbolic link. Its name is the pathname pointed to by path2, which must be a pathname that does not name an existing
file or symbolic link. The contents of the symbolic link are the string pointed to by path1.
RETURN VALUE
Upon successful completion, returns 0. Otherwise, it returns -1 and sets to indicate the error.
ERRORS
If fails, is set to one of the following values:
[EACCES] Write permission is denied in the directory where the symbolic link is being created, or search permission
is denied for a component of the path prefix of path2.
[EEXIST] The path2 argument names an existing file or symbolic link.
[EFAULT] path1 or path2 points outside the process's allocated address space. The reliable detection of this error
is implementation-dependent.
[EIO] An I/O error occurred while reading from path1, making the directory entry for path2, allocating the inode
for path2, or writing out the link contents of path2.
[ELOOP] Too many symbolic links were encountered in resolving path2.
[ENAMETOOLONG] The length of the path2 argument exceeds or pathname resolution of a symbolic link produced an intermediate
result that exceeds or a pathname component is longer than
[ENOENT] A component of path2 does not name an existing file or path2 is an empty string.
[ENOSPC] The directory in which the entry for the new symbolic link is being placed cannot be extended because no
space is left on the file system containing the directory, or the new symbolic link cannot be created
because no space is left on the file system which will contain the link, or the file system is out of file-
allocation resources.
[ENOTDIR] A component of the path prefix of path2 is not a directory.
[EROFS] The new symbolic link would reside on a read-only file system.
APPLICATION USAGE
Like a hard link, a symbolic link allows a file to have multiple logical names. The presence of a hard link guarantees the existence of a
file, even after the original name has been removed. A symbolic link provides no such assurance; in fact, the file named by the path1 argu-
ment need not exist when the link is created. A symbolic link can cross file system boundaries.
Normal permission checks are made on each component of the symbolic link pathname during its resolution.
AUTHOR
was developed by the University of California, Berkeley.
SEE ALSO
cp(1), chown(2), link(2), lstat(2), open(2), readlink(2), unlink(2), symlink(4), <unistd.h>.
STANDARDS CONFORMANCE
CHANGE HISTORY
First released in Issue 4, Version 2.
symlink(2)