Sponsored Content
Full Discussion: validate each field in txt
Top Forums Shell Programming and Scripting validate each field in txt Post 302128866 by happyv on Thursday 26th of July 2007 11:28:14 PM
Old 07-27-2007
change time format

hello,

I have a record below and would like to change the time fromat from m:ss to mm:ss

input
00001,CUSTR,CUSTOMER,02310,N,0:00,0,0,0,0,0,0,0,0,0,0,0,0:00,0,0,0,0,0,CSH,
00001,CUSTR,CUSTOMER,02310,N,5:12,0,0,0,0,0,0,0,0,0,0,0,1:10,0,0,0,0,0,CSH,

output
00001,CUSTR,CUSTOMER,02310,N,00:00,0,0,0,0,0,0,0,0,0,0,0,00:00,0,0,0,0,0,CSH,
00001,CUSTR,CUSTOMER,02310,N,05:12,0,0,0,0,0,0,0,0,0,0,0,01:10,0,0,0,0,0,CSH,
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Reindex or re-increment last field of txt file.

I am using a database text file with a field that increments +1 with each new entry, occasionally if a entry is deleted the unique sequence is disrupted. I am looking for a small script/function in sh and/or perl that would re index this. Example of db file: Name | Address | misc |number... (2 Replies)
Discussion started by: silenthands
2 Replies

2. UNIX for Dummies Questions & Answers

echo "ABC" > file1.txt file2.txt file3.txt

Hi Guru's, I need to create 3 files with the contents "ABC" using single command. Iam using: echo "ABC" > file1.txt file2.txt file3.txt the above command is not working. pls help me... With Regards / Ganapati (4 Replies)
Discussion started by: ganapati
4 Replies

3. Shell Programming and Scripting

how to validate a field when it is blank using awk prog

Hi, I tried the below piece of code for my script to check whether it has a blank space for a particular field. if(f10==/]/){ print "Field 10 is Correct";} else{ print "Field 10 is Wrong"; } Please help me to know whether the "if" condition applied here is correct or do i... (14 Replies)
Discussion started by: meva
14 Replies

4. Shell Programming and Scripting

gawk help for inserting a field of a .txt file in the same file

i had the following type of data file vchrdump: Vouchers For Date :05/01/2009 * ... (4 Replies)
Discussion started by: KANNI786
4 Replies

5. Shell Programming and Scripting

how to add extra a field in a flat txt file ?

Hi all, I did not use UNIX for a long time, now i need to make a flat file with extra field, can you help me with the code ? 1. I create a last line of each log from each system and make it in a flat text file (seperate by a pipe |) mv current.log old tail -1 sanfrancisco.log > current.log... (5 Replies)
Discussion started by: britney
5 Replies

6. UNIX for Dummies Questions & Answers

find lines in file1.txt not found in file2.txt memory problem

I have a diff command that does what I want but when comparing large text/log files, it uses up all the memory I have (sometimes over 8gig of memory) diff file1.txt file2.txt | grep '^<'| awk '{$1="";print $0}' | sed 's/^ *//' Is there a better more efficient way to find the lines in one file... (5 Replies)
Discussion started by: raptor25
5 Replies

7. Shell Programming and Scripting

awk append fileA.txt to growing file B.txt

This is appending a column. My question is fairly simple. I have a program generating data in a form like so: 1 20 2 22 3 23 4 12 5 43 For ever iteration I'm generating this data. I have the basic idea with cut -f 2 fileA.txt | paste -d >> FileB.txt ???? I want FileB.txt to grow, and... (4 Replies)
Discussion started by: theawknewbie
4 Replies

8. Shell Programming and Scripting

Need to append the date | abcddate.txt to the first line of my txt file

I want to add/append the info in the following format to my.txt file. 20130702|abcd20130702.txt FN|SN|DOB I tried the below script but it throws me some exceptions. <#!/bin/sh dt = date '+%y%m%d'members; echo $dt+|+members+$dt; /usr/bin/awk -f BEGIN { FS="|"; OFS="|"; } { print... (6 Replies)
Discussion started by: harik1982
6 Replies

9. Shell Programming and Scripting

Desired output.txt for reading txt file using awk?

Dear all, I have a huge txt file (DATA.txt) with the following content . From this txt file, I want the following output using some shell script. Any help is greatly appreciated. Greetings, emily DATA.txt (snippet of the huge text file) 407202849... (2 Replies)
Discussion started by: emily
2 Replies

10. Shell Programming and Scripting

Awk, sed, shell all words in INPUT.txt find in column1 of TABLE.txt and replce with column2 in

Hi dears i have text file like this: INPUT.txt 001_1_173 j nuh ]az 001_1_174 j ]esma. nuh ]/.xori . . . and have another text like this TABLE.txt j j nuh word1... (6 Replies)
Discussion started by: alii
6 Replies
tar.h(3HEAD)							      Headers							      tar.h(3HEAD)

NAME
tar.h, tar - extended tar definitions SYNOPSIS
#include <tar.h> DESCRIPTION
The <tar.h> header defines header block definitions as follows. Name Description Value TMAGIC "ustar" ustar plus null byte TMAGLEN 6 length of the above TVERSION "00" 00 without a null byte TVERSLEN 2 length of the above Typeflag field definitions: Name Description Value REGTYPE '0' regular file AREGTYPE '' regular file LNKTYPE '1' link SYMTYPE '2' symbolic link CHRTYPE '3' character special BLKTYPE '4' block special DIRTYPE '5' directory FIFOTYPE '6' FIFO special CONTTYPE '7' reserved Mode field bit definitions (octal): Name Description Value TSUID 04000 set UID on execution TSGID 02000 set GID on execution TSVTX 01000 on directories, restricted deletion flag TUREAD 00400 read by owner TUWRITE 00200 write by owner special TUEXEC 00100 execute/search by owner TGREAD 00040 read by group TGWRITE 00020 write by group TGEXEC 00010 execute/search by group TOREAD 00004 read by other TOWRITE 00002 write by other TOEXEC 00001 execute/search by other ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Standard | +-----------------------------+-----------------------------+ SEE ALSO
pax(1), attributes(5), standards(5) SunOS 5.10 10 Sep 2004 tar.h(3HEAD)
All times are GMT -4. The time now is 11:59 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy