Problem in moving files to .txt


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Problem in moving files to .txt
# 1  
Old 03-20-2007
Problem in moving files to .txt

Hello All
Iam running one script to Split the file and rename it with .txt extension

Script
Prefix=Z_PRICE_NEW_`date "+%Y%m%d%H%M%S"`
split -3000 -a 4 Z_PRICE_NEW.txt $Prefix
find . -name "$Prefix*" -print | {
while read FILE;
do
mv $FILE $FILE.tmp
done
}

Since the Source file was huge areound 350 MB the split countrer was two characters Z_PRICE_NEW20070319231757aa.txt,with this i can split only 676 files at the max ,so i tried ti increase the counter by 4 instead of two whic was default"-a 4",
This script is working filne but some of the file are splitted and coming like this
Z_PRICE_NEW20070319231757aaae.txt.txt

Iam not able to figure out why there are two .txt extensions coming ,
If any one can help me it will be very useful

Regards
Tausif
# 2  
Old 03-26-2007
query for the above one..

split -3000 -a 4 Z_PRICE_NEW.txt $Prefix

what this command does here......

plz expalin it....
# 3  
Old 03-26-2007
split -3000 -a 4 Z_PRICE_NEW.txt $Prefix

what this command does here......

plz expalin it....

Its splits the file contatining 3000 rows each and concatenates $prefix(in this case timestamp) with
Z_PRICE_NEW.txt
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Problem in compressing and moving files

Hi I am writing a sample script (sample.ksh) to compress files in the source directory and move them to another directory. The script takes a config file (files.config) as the paramter the contents of which are as given under: /abc/src ${TSTENV}-xxx-yyy~1.log /abc/src/dest /abc/src... (8 Replies)
Discussion started by: swasid
8 Replies

2. Shell Programming and Scripting

Compare two txt files,mismatches will be in new txt files

Hi, Below are the sample data for txt files. txt file 1 Partnumber|catgroup_id 10001082|46016 10001093|4680 10001093|386003 10001093|463004 10003251|683 10003251|63005 10003252|463005 10003252|4683 10003260|463005 10003260|4683 10003264|4683 10003264|463005 13420000|67... (5 Replies)
Discussion started by: Ankita Talukdar
5 Replies

3. Shell Programming and Scripting

Finding files with wc -l results = 1 then moving the files to another folder

Hi guys can you please help me with a script to find files with one row/1 line of content then move the file to another directory my script below runs but nothing happens to the files....Alternatively Ca I get a script to find the *.csv files with "wc -1" results = 1 then create a list of those... (5 Replies)
Discussion started by: Dj Moi
5 Replies

4. 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

5. Shell Programming and Scripting

moving the files in a.txt files to a different directory

HI All, I am coding a shell script which will pick all the .csv files in a particular directoryand write it in to a .txt file, this .txt file i will use as a source in datastage for processing. now after the processing is done I have to move and archive all the files in the .txt file to a... (5 Replies)
Discussion started by: subhasri_2020
5 Replies

6. Solaris

list files .txt and .TXT in one command

Dear experts, In a directory i have both *.TXT and *.txt files. I have a script- for file in `ls *.txt`; do mv $file /tmp/$file How to list both *.txt and*.TXT file in one command so that script will move both .txt or .TXT whatever it find. br//purple (4 Replies)
Discussion started by: thepurple
4 Replies

7. UNIX for Dummies Questions & Answers

problem with grep on search string in a txt file over multiple files

I have a couple of things I got stuck on 1) I have a text file containing 25k search string that I need to search against compressed file. I have used this command but somehow it doesn't seems to use all the search terms. I have put one search string per line in the txt file (I clean up... (2 Replies)
Discussion started by: m00
2 Replies

8. Shell Programming and Scripting

Moving lines within a txt file

A newbie to shell scripting..... I need some assistance in doing the following: I have a system generated text file(a makefile basically). Before I can execute the make command, I need to modify one section of this generated file. The generated section is as follows: # INCLUDE macro... (5 Replies)
Discussion started by: innocentspirit
5 Replies

9. Shell Programming and Scripting

Sorting problem "sort -k 16,29 sample.txt > output.txt"

Hi all, Iam trying to sort the contents of the file based on the position of the file. Example: $cat sample.txt 0101020060731 ## Header record 1c1 Berger Awc ANP20070201301 4000.50 1c2 Bose W G ANP20070201609 6000.70 1c2 Andy CK ANP20070201230 28000.00... (3 Replies)
Discussion started by: ganapati
3 Replies

10. Shell Programming and Scripting

Problem while moving a file

Dear Friends, You can easily understand my problem after looking into the code. test1.sh -------- #!/bin/sh LOG_HOME="/home/vel" while do echo `date` done test2.sh -------- #!/bin/sh LOG_HOME="/home/vel" if then sh $LOG_HOME/test1.sh >> $LOG_HOME/1.log (5 Replies)
Discussion started by: smvel
5 Replies
Login or Register to Ask a Question