Don't exactly understand what you want, but here is one suggestion
Then you can adjust the lengths (the path (second field) will adjust the last field if the path is longer then 40 characters with above example).
Thanks for your reply....
I don't know the length of the second field, all data is coming dynamically, is there a way i can print 3 field starting from 50th location towards right, doesn't matter what is the length of 1'st and 2'nd fields.
Hi Unix Champs,
I want to awk on a fixed length file.
Instead if the file was a delimited file, then I could have used -F and then could have easily done manipulation on the fields.
How do i do the same in case of fixed length file?
Thanks in Advance.
Regards. (7 Replies)
OK I am somewhat new to UNIX programming please see what you can do to help.
I have a flat file that is a fixed length file containing different records based on the 1st character of each line. The 1st number at the beginning of the line is the record number, in this case it's record #1.
I... (3 Replies)
Hi, I have two files.
File1:
File1 contains two fixed width columns ID of 15 characters length and Name is of 100 characters length.
ID Name
1-43<<11 spaces>>Swapna<<94 spaces>>
1-234<<10 spaces>>Mani<<96 spaces>>
1-3456<<9 spaces>>Kapil<<95 spaces>>
File2:
... (4 Replies)
Hi guys,
I have tried to find a solution for this problem but couln't. If anyone of you have an Idea do help me.
INPUT_FILE
with three columns shown to be separated by - sign
A5BNK723NVI - 1 - 294
A7QZM0VIT - 251 - 537
A7NU3411V - 245 - 527
I want an output file in which First column... (2 Replies)
Problem:
entry_name="joke:hello:yellow:blue:default"
print("%d %-12s\t%-10s\t%-5s\n", $i, $entry_name....);
I just want to print the output like this
index entry value ....
1 joke:hello:y 0 123 567
ellow:blue:d
... (1 Reply)
Hi Everyone,
I need a shell/perl script to bring selected columns from all the files located in a directory and place them in a new file side by side.
File1:
a b c d
2 3 4 5
f g h i
..........
File2:
I II III IV
w x y z
..............
and so on many files are there...... (8 Replies)
I was trying to use the AIX 6.1 sort command to sort fixed-length data records, sorting by specific columns only. It took some time to figure out how to get it to work, so I wanted to share the solution. The sort man page wasn't much help, because it talks about field delimeters (default space... (1 Reply)
How do I extract values in a few columns in a row of a fixed length file?
If there are 8 columns and I need to extract values of 2nd,4th and 6 th columns, how do i do that? I used cut command, this I used only for one column. How do I do it more than one column?
The below command will give... (1 Reply)
Hi,
I need to split a fixed length file of 160 characters based on value of a column. Example:
ABC 456780001 DGDG SDFSF
BCD 444440002 SSSS TTTTT
ABC 777750003 HHHH UUUUU
THH 888880001 FFFF LLLLLL
HHH 999990002 GGGG OOOOO
I need to split this file on basis of column from... (7 Replies)
Discussion started by: Neelkanth
7 Replies
LEARN ABOUT PHP
mssql_field_length
MSSQL_FIELD_LENGTH(3)MSSQL_FIELD_LENGTH(3)mssql_field_length - Get the length of a fieldSYNOPSIS
int mssql_field_length (resource $result, [int $offset = -1])
DESCRIPTION
Returns the length of field no. $offset in $result.
PARAMETERS
o $result
- The result resource that is being evaluated. This result comes from a call to mssql_query(3).
o $offset
- The field offset, starts at 0. If omitted, the current field is used.
RETURN VALUES
The length of the specified field index on success or FALSE on failure.
EXAMPLES
Example #1
mssql_field_length(3) example
<?php
// Connect to MSSQL and select the database
mssql_connect('MANGOSQLEXPRESS', 'sa', 'phpfi');
mssql_select_db('php');
// Send a select query to MSSQL
$query = mssql_query('SELECT [name], [age] FROM [php].[dbo].[persons]');
// Print the field length
echo 'The field 'age' has a data length of ' . mssql_field_length($query, 1);
// Free the query result
mssql_free_result($query);
?>
The above example will output something similar to:
The field 'age' has a data length of 4
NOTES
Note
Note to Windows Users
Due to a limitation in the underlying API used by PHP (MS DBLib C API), the length of VARCHAR fields is limited to 255. If you need
to store more data, use a TEXT field instead.
SEE ALSO mssql_field_name(3), mssql_field_type(3).
PHP Documentation Group MSSQL_FIELD_LENGTH(3)