Sponsored Content
Full Discussion: Concatenate 560 files in one
Top Forums UNIX for Dummies Questions & Answers Concatenate 560 files in one Post 302761741 by biopsy on Saturday 26th of January 2013 03:49:13 PM
Old 01-26-2013
Concatenate 560 files in one

HI all,
could please help me in this code. I have 560 files containing the same columns but different rows. i want to concatenate all these files in one big file. i want to keep the header of the first file then add the dat from other files horizontally.
the name of my files contains 2 variables : chunk number and chromosome number. this an example

code:
IMP_chunk11-chr6_file

i have tried this code but it works only for one variable and 22 files. anu suggestion to adapt it to my case

code :


Code:
for p in 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
do
more +2 EUR.chr${p}.Fst > EUR.chr${p}.Fst.tmp
done

cp EUR.chr1.Fst EUR.chr1.Fst.tmp

cat EUR.chr*.Fst.tmp > EUR.all.Fst

thank you veru much

Moderator's Comments:
Mod Comment edit by bakunin: Please reread the rules, CODE-tags are not optional when posting code. Thank you.

Last edited by bakunin; 01-26-2013 at 06:29 PM..
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to concatenate all files.

Hi, I'm totally new to Unix. I'm an MVS mainframer but ran into a situation where a Unix server I have available will help me. I want to be able to remotely connect to another server using FTP, login and MGET all files from it's root or home directory, logout, then login as a different user and do... (1 Reply)
Discussion started by: s80bob
1 Replies

2. Shell Programming and Scripting

concatenate two files with different No of rows

need a shell which perform following function file 1 ( every time new data comes) 1212 2323 3434 4545 5656 . . . . file 2 (fixed line) update bc_tbl set aix=data , bix=back where cix=U and serial=; now when i execute shell it will concatinate file 1, file 2 & make file 3 as... (3 Replies)
Discussion started by: The_Archer
3 Replies

3. Shell Programming and Scripting

Concatenate files

I have directory structure sales_only under which i have multiple directories for each dealer example: ../../../Sales_Only/xxx_Dealer ../../../Sales_Only/yyy_Dealer ../../../Sales_Only/zzz_Dealer Every day i have one file produce under each directory when the process runs. The requirement... (3 Replies)
Discussion started by: mohanmuthu
3 Replies

4. Shell Programming and Scripting

Concatenate files

Hi, I want to create a batch(bash) file to combine 23 files together. These files have the same extension. I want the final file is save to a given folder. Once it is done it will delete the 23 files. Thanks for help. Need script. (6 Replies)
Discussion started by: zhshqzyc
6 Replies

5. Shell Programming and Scripting

Concatenate files

I have a file named "file1" which has the following data 10000 20000 30000 And I have a file named "file2" which has the following data ABC DEF XYZ My output should be 10000ABC 20000DEF (3 Replies)
Discussion started by: bobby1015
3 Replies

6. Fedora

Concatenate Numerous Files

Hey! I wanted to find a text version of the Bible for purposes of grepping. The only files I could find, (in the translation I wanted), were Old Testament.txt and New Testament.txt. I thought, "fine, I'll just concatenate those two, no problemo." But when I unpacked them, turns out they had each... (22 Replies)
Discussion started by: sudon't
22 Replies

7. UNIX for Dummies Questions & Answers

Concatenate Several Files to One

Hi All, Need your help. I will need to concatenate around 100 files but each end of the file I will need to insert my name DIRT1228 on each of the file and before the next file is added and arrived with just one file for all the 100files. Appreciate your time. Dirt (6 Replies)
Discussion started by: dirt1228
6 Replies

8. UNIX for Dummies Questions & Answers

Concatenate files

Hi I am trying to learn linux step by step an i am wondering can i use cat command for concatenate files but i want to place context of file1 to a specific position in file2 place of file 2 and not at the end as it dose on default? Thank you. (3 Replies)
Discussion started by: iliya24
3 Replies

9. UNIX for Dummies Questions & Answers

Concatenate files and delete source files. Also have to add a comment.

- Concatenate files and delete source files. Also have to add a comment. - I need to concatenate 3 files which have the same characters in the beginning and have to remove those files and add a comment and the end. Example: cat REJ_FILE_ABC.txt REJ_FILE_XYZ.txt REJ_FILE_PQR.txt >... (0 Replies)
Discussion started by: eskay
0 Replies
STRFMON(3)						     Linux Programmer's Manual							STRFMON(3)

NAME
strfmon, strfmon_l - convert monetary value to a string SYNOPSIS
#include <monetary.h> ssize_t strfmon(char *s, size_t max, const char *format, ...); ssize_t strfmon_l(char *s, size_t max, locale_t locale, const char *" format , ...); DESCRIPTION
The strfmon() function formats the specified monetary amount according to the current locale and format specification format and places the result in the character array s of size max. The strfmon_l() function performs the same task, but uses the locale specified by locale. The behavior of strfmon_l() is undefined if locale is the special locale object LC_GLOBAL_LOCALE (see duplocale(3)) or is not a valid locale object handle. Ordinary characters in format are copied to s without conversion. Conversion specifiers are introduced by a '%' character. Immediately following it there can be zero or more of the following flags: =f The single-byte character f is used as the numeric fill character (to be used with a left precision, see below). When not speci- fied, the space character is used. ^ Do not use any grouping characters that might be defined for the current locale. By default, grouping is enabled. ( or + The ( flag indicates that negative amounts should be enclosed between parentheses. The + flag indicates that signs should be han- dled in the default way, that is, amounts are preceded by the locale's sign indication, for example, nothing for positive, "-" for negative. ! Omit the currency symbol. - Left justify all fields. The default is right justification. Next, there may be a field width: a decimal digit string specifying a minimum field width in bytes. The default is 0. A result smaller than this width is padded with spaces (on the left, unless the left-justify flag was given). Next, there may be a left precision of the form "#" followed by a decimal digit string. If the number of digits left of the radix charac- ter is smaller than this, the representation is padded on the left with the numeric fill character. Grouping characters are not counted in this field width. Next, there may be a right precision of the form "." followed by a decimal digit string. The amount being formatted is rounded to the specified number of digits prior to formatting. The default is specified in the frac_digits and int_frac_digits items of the current locale. If the right precision is 0, no radix character is printed. (The radix character here is determined by LC_MONETARY, and may dif- fer from that specified by LC_NUMERIC.) Finally, the conversion specification must be ended with a conversion character. The three conversion characters are % (In this case, the entire specification must be exactly "%%".) Put a '%' character in the result string. i One argument of type double is converted using the locale's international currency format. n One argument of type double is converted using the locale's national currency format. RETURN VALUE
The strfmon() function returns the number of characters placed in the array s, not including the terminating null byte, provided the string, including the terminating null byte, fits. Otherwise, it sets errno to E2BIG, returns -1, and the contents of the array is unde- fined. ATTRIBUTES
For an explanation of the terms used in this section, see attributes(7). +------------+---------------+----------------+ |Interface | Attribute | Value | +------------+---------------+----------------+ |strfmon() | Thread safety | MT-Safe locale | +------------+---------------+----------------+ |strfmon_l() | Thread safety | MT-Safe | +------------+---------------+----------------+ CONFORMING TO
POSIX.1-2001, POSIX.1-2008. EXAMPLE
The call strfmon(buf, sizeof(buf), "[%^=*#6n] [%=*#6i]", 1234.567, 1234.567); outputs [EUR **1234,57] [EUR **1 234,57] in the nl_NL locale. The de_DE, de_CH, en_AU, and en_GB locales yield [ **1234,57 EUR] [ **1.234,57 EUR] [ Fr. **1234.57] [ CHF **1'234.57] [ $**1234.57] [ AUD**1,234.57] [ L**1234.57] [ GBP**1,234.57] SEE ALSO
duplocale(3), setlocale(3), sprintf(3), locale(7) Linux 2017-09-15 STRFMON(3)
All times are GMT -4. The time now is 10:27 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy