06-16-2014
Hi,
The ASCII code for group separator is 29. I have used this particular character to separate out two words. Actually it's a text file, holding all text data. Hence it should show as ASCII Text file by the file command. But it's recognized as data file due to group separator 29.
Please help me to find out a way, so that it could be recognized as Text file.
10 More Discussions You Might Find Interesting
1. Programming
Hi All
I am simulating a problem in the production where i faced a situation.
Please find the following example program which i simulated.
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
int main()
{
char str1; (3 Replies)
Discussion started by: dhanamurthy
3 Replies
2. Shell Programming and Scripting
i have no idea abount shell script but i need need shell script to get last 10 char from a file name and write in to a new file.
consider u hav 5 files in a particular dir i script should get last 10 char of each file n write the 10 char in separate files (2 Replies)
Discussion started by: raj0390
2 Replies
3. Shell Programming and Scripting
I've this file and need to sort the data in each group
File would look like this ...
cat file1.txt
Reason : ABC
12345-0023
32123-5400
32442-5333
Reason : DEF
42523-3453
23345-3311
Reason : HIJ
454553-0001
I would like to sort each group on the last 4 fileds and print them... (11 Replies)
Discussion started by: prash184u
11 Replies
4. Shell Programming and Scripting
Hi all,
I'm reading a file with this layout:
First_Col Second_Col
The Second_Col has values as 1000, -1, 10, 43...
While reading the file I'm getting the second column value with awk command, but it is including the CR control char.
do
item_saved=`echo $b | awk '{print... (4 Replies)
Discussion started by: mrreds
4 Replies
5. Programming
hi
I have the below code to convert hexa to binary. It is working fine, but i want to store the binary in char or int. The below program is printing the result.
void ConvertHexToBinary(char sHexValue)
{
int i;
printf("Binary Equivalent=");
for(i=0;sHexValue!=NULL;i++)
{
... (1 Reply)
Discussion started by: atharalikhan
1 Replies
6. Shell Programming and Scripting
Hi
I am using sed command to make SCORE=somevalue to SCORE=blank in a file.
Please see the attached lastline.txt file. After executing the below command on the file, it removes the last line.
cat lastline.txt | sed 's/SCORE=.*$/SCORE=/g' > newfile.txt
Why does sed command remove the... (3 Replies)
Discussion started by: ashok.k
3 Replies
7. Shell Programming and Scripting
/etc/group
tiadm::345:mk789,po312,jo343,ju454,ko453,yx879,iy345,hn453
bin::2:root,daemon
sys::3:root,bin,adm
adm::4:root,daemon
uucp::5:root
/etc/passwd
mk789:x:234:1::/export/home/dummy:/bin/sh
po312:x:234:1::/export/home/dummy:/bin/sh
ju454:x:234:1::/export/home/dummy:/bin/sh... (6 Replies)
Discussion started by: chidori
6 Replies
8. Shell Programming and Scripting
path = content.txt
filename = application
directory = _modules
define create
$(eval from := $(shell echo $$1)) \
$(eval to := $(shell echo $$2)) \
sed -i '' 's/$(from)/$(to)/g' content.txt
endef
all:
clear
$(eval modules := $(shell egrep -o "{module+\}" $(path)))
... (1 Reply)
Discussion started by: bmson
1 Replies
9. Shell Programming and Scripting
I am trying to add a unique identifier to two file extensions .bam and .vcf in a directory located at /home/cmccabe/Desktop/index/R_2016_09_21_14_01_15_user_S5-00580-9-Medexome.
The identifier is in $2 of the input file. What the code below is attempting to do is strip off the last portion... (21 Replies)
Discussion started by: cmccabe
21 Replies
10. UNIX for Advanced & Expert Users
Unix File is pipe delimited with 17 fields. We may get extra pipes in data also.
We may get \n char (1 or more \n in one field or multi fileds) in data in any field.
Need to replace \n true ( line separator) with 'space and bell char space' chars (' \a ') Not data \n.
Input:... (1 Reply)
Discussion started by: rajeshkumare
1 Replies
LEARN ABOUT DEBIAN
text::flow::wrap
Text::Flow::Wrap(3pm) User Contributed Perl Documentation Text::Flow::Wrap(3pm)
NAME
Text::Flow::Wrap - Flexible word wrapping for not just ASCII output.
SYNOPSIS
use Text::Flow::Wrap;
# for regular ASCII usage ...
my $wrapper = Text::Flow::Wrap->new(
check_width => sub { length($_[0]) < 70 },
);
# for non-ASCII usage ...
my $wrapper = Text::Flow::Wrap->new(
check_width => sub { $pdf->get_text_width($_[0]) < 500 },
);
my $text = $wrapper->wrap($text);
DESCRIPTION
The main purpose of this module is to provide text wrapping features without being tied down to ASCII based output and fixed-width fonts.
My needs were for sophisticated test control in PDF and GIF output formats in particular.
METHODS
new (%params)
This constructs a new Text::Flow::Wrap module whose %params set the values of the attributes listed below.
wrap ($text)
This method will accept a bunch of text, it will then return a new string which is wrapped to the expected width.
Attribute Accessors
check_width (&code)
This attribute is required, and must be a CODE reference. This will be used to determine if the width of the text is appropriate. It
will get as an argument, a string which is should check the width of. It should return a Boolean value, true if the string is not
exceeded the max width and false if it has.
line_break ($str)
This is the line break character used when assembling and disassembling the text, it defaults to the newline character "
".
paragraph_boundry ($str)
This is the paragraph boundry marker used when disassembling the text, it defaults to the string "
".
paragraph_break ($str)
This is the paragraph breaker used when re-assembling the text, it defaults to the string "
".
word_boundry ($str)
This is the word boundry marker used when disassembling the text, it defaults to a single space character.
word_break ($str)
This is the paragraph breaker used when re-assembling the text, it defaults to a single space character.
Paragraph Disassembling
These methods deal with breaking up the paragraphs into its parts, which can then be processed through the re-assembling methods.
These methods are mostly used internally, but more sophisticated tools might need to access them as well (see Text::Flow).
disassemble_paragraph
disassemble_paragraphs
Paragraph Reassembling
These methods deal with putting the paragraph parts back together after the disassembling methods have done thier work.
These methods are mostly used internally, but more sophisticated tools might need to access them as well (see Text::Flow)
reassemble_paragraph
reassemble_paragraphs
Introspection
meta
Returns the Moose meta object associated with this class.
BUGS
All complex software has bugs lurking in it, and this module is no exception. If you find a bug please either email me, or add the bug to
cpan-RT.
AUTHOR
Stevan Little <stevan@iinteractive.com>
COPYRIGHT AND LICENSE
Copyright 2007 by Infinity Interactive, Inc.
<http://www.iinteractive.com>
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
perl v5.10.1 2007-05-21 Text::Flow::Wrap(3pm)