Preserve byte size of fields while pasting it to other file


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Preserve byte size of fields while pasting it to other file
# 1  
Old 11-28-2009
Preserve byte size of fields while pasting it to other file

Hello
I want to set two fields in a text file to be of size 20.
how to do it using unix ?
eg: ABC.txt

Name | City

I want Name and City both to be of size 20.

Also If I am pasting it in other file the byte size should be preserved.i.e. If I want to append content of ABC.txt to other PQR.txt,
I shall use
paste -d'|' PQR.txt ABC.txt > tmp.tmp

Now
file tmp.tmp should reflect my ABC file content of size 20 each.

Seeking quick suggestions ...
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Ls directory size reporting byte size instead of file count

I have been searching both on Unix.com and Google and have not been able to find the answer to my question. I think it is partly because I can't come up with the right search terms. Recently, my virtual server switched storage devices and I think the problem may be related to that change.... (2 Replies)
Discussion started by: jmgibby
2 Replies

2. Shell Programming and Scripting

How to preserve spaces in input fields with awk?

I'm trying to do something pretty simple but its appears more complicated than expected... I've lines in a text file, separated by the comma and that I want to output to another file, without the first field. Input file: file1,item, 12345678 file2,item, 12345678 file2,item, ... (8 Replies)
Discussion started by: Armoric
8 Replies

3. Shell Programming and Scripting

Calculate byte size of string

Hi, I have task to merge multiple XML's to one big XML. In doing this i have to calculate the byte size of each XML which i will be recieving as a string from a code and append all the recieved XML's to single file. The reason being the byte size and the offset will help me to extract only... (7 Replies)
Discussion started by: chetan.c
7 Replies

4. Shell Programming and Scripting

reading files and pasting in another text file

Hi all, I have certain task to do, which involves reading the first column of 1.txt file. This is variable "event" 28434710 23456656 3456895 & finding this "event" in some other text file 2.txt, which has information in the following format #Zgamma: 1 run: 160998 event: ... (7 Replies)
Discussion started by: nrjrasaxena
7 Replies

5. UNIX for Dummies Questions & Answers

Pasting a column into a text file

I have two text files: One is a single column of numbers and the other is a space delimited text file with multiple columns. I want to paste the single column of numbers into the second column of the latter text file. How do I go about doing that? Thanks! (1 Reply)
Discussion started by: evelibertine
1 Replies

6. Shell Programming and Scripting

data searching and pasting with in the file

Hi All, I have .csv file in which I am trying to manipulate a column date, I started with awk but i am not sure how to do the below logic in . the file has a 23 columns and in the first row if the value is Trend and in the second column the value is Analysis then the program has to... (3 Replies)
Discussion started by: shruthidwh
3 Replies

7. Shell Programming and Scripting

pasting fields from two files into one

i have two files with contents file a 1234,abcf 2345,drft 4444,befr file b tom,3 sam,5 dog,7 i want to print first column of file b and join to file a and get output as below tom,1234,abcf sam,2345,drft dog,4444,befr (2 Replies)
Discussion started by: dealerso
2 Replies

8. Shell Programming and Scripting

Preserve byte size of fields while pasting it to other file in unix

Preserve byte size of fields while pasting it to other file Hello I want to set two fields in a text file to be of size 20. how to do it using unix ? eg: ABC.txt Name | City I want Name and City both to be of size 20. Also If I am pasting it in other file the byte size should be... (1 Reply)
Discussion started by: dashing201
1 Replies

9. Shell Programming and Scripting

Check if 2 files are identical byte-to-byte?

In my server migration requirement, I need to compare if one file on old server is exactly the same as the corresponding file on the new server. For diff and comm, the inputs need to be sorted. But I do not want to disturb the content of the file and need to find byte-to-byte match. Please... (4 Replies)
Discussion started by: krishmaths
4 Replies

10. UNIX for Dummies Questions & Answers

pasting text into an existing file

I have a text file that has over 300 lines that I need to paste identical data to. What is the easiest way to do this? For example if I have a file that has lines of text xxxxxxxx and I would like to change each line to look like this "display text(xxxxxxxx)". What would be the easiest way to do... (3 Replies)
Discussion started by: darthur
3 Replies
Login or Register to Ask a Question
MYSQLI_INFO(3)								 1							    MYSQLI_INFO(3)

mysqli::$info - Retrieves information about the most recently executed query

       Object oriented style

SYNOPSIS
string$mysqli->info () DESCRIPTION
Procedural style string mysqli_info (mysqli $link) The mysqli_info(3) function returns a string providing information about the last query executed. The nature of this string is provided below: Possible mysqli_info return values +---------------------------------------+----------------------------------------------+ | Query type | | | | | | | Example result string | | | | +---------------------------------------+----------------------------------------------+ | INSERT INTO...SELECT... | | | | | | | Records: 100 Duplicates: 0 Warnings: 0 | | | | |INSERT INTO...VALUES (...),(...),(...) | | | | | | | Records: 3 Duplicates: 0 Warnings: 0 | | | | | LOAD DATA INFILE ... | | | | | | | Records: 1 Deleted: 0 Skipped: 0 Warnings: 0 | | | | | ALTER TABLE ... | | | | | | | Records: 3 Duplicates: 0 Warnings: 0 | | | | | UPDATE ... | | | | | | | Rows matched: 40 Changed: 40 Warnings: 0 | | | | +---------------------------------------+----------------------------------------------+ Note Queries which do not fall into one of the preceding formats are not supported. In these situations, mysqli_info(3) will return an empty string. PARAMETERS
o $ link -Procedural style only: A link identifier returned by mysqli_connect(3) or mysqli_init(3) RETURN VALUES
A character string representing additional information about the most recently executed query. EXAMPLES
Example #1 $mysqli->info example Object oriented style <?php $mysqli = new mysqli("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s ", mysqli_connect_error()); exit(); } $mysqli->query("CREATE TEMPORARY TABLE t1 LIKE City"); /* INSERT INTO .. SELECT */ $mysqli->query("INSERT INTO t1 SELECT * FROM City ORDER BY ID LIMIT 150"); printf("%s ", $mysqli->info); /* close connection */ $mysqli->close(); ?> Procedural style <?php $link = mysqli_connect("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s ", mysqli_connect_error()); exit(); } mysqli_query($link, "CREATE TEMPORARY TABLE t1 LIKE City"); /* INSERT INTO .. SELECT */ mysqli_query($link, "INSERT INTO t1 SELECT * FROM City ORDER BY ID LIMIT 150"); printf("%s ", mysqli_info($link)); /* close connection */ mysqli_close($link); ?> The above examples will output: Records: 150 Duplicates: 0 Warnings: 0 SEE ALSO
mysqli_affected_rows(3), mysqli_warning_count(3), mysqli_num_rows(3). PHP Documentation Group MYSQLI_INFO(3)