Angus Leeming | 10 Oct 2003 21:22
Favicon

Re: ascii output

Templier Antony wrote:
> Hi,
> 
> Is there is a way to produce ascii file with no limit to lenght of
> line for each bloc text ?

Add this to your .lyx/preferences file. (If the file doesn't exist, 
create a new one.)

\ascii_linelen your_length

Alternatively, use the Preferences dialog (Edit->Preferences) and the 
Outputs->ASCII pane (Qt) or Outputs->Misc tab (xforms)

That will put set the linelength for each paragraph.

If you really want a file with no line breaks, use sed. Eg

sed ':loop
$!{
N
s/\n/ /
tloop
}' your_file.txt > a_file_with_a_single_really_long_line.txt

Of course, this assumes that you are using an OS that has sed (-;

--

-- 
Angus

(Continue reading)

Antony Templier | 10 Oct 2003 23:07
Picon

Re: ascii output

Angus Leeming wrote:
> Templier Antony wrote:
> 
>>Hi,
>>
>>Is there is a way to produce ascii file with no limit to lenght of
>>line for each bloc text ?
> 
> 
> Add this to your .lyx/preferences file. (If the file doesn't exist, 
> create a new one.)
> 
> \ascii_linelen your_length
> 
> Alternatively, use the Preferences dialog (Edit->Preferences) and the 
> Outputs->ASCII pane (Qt) or Outputs->Misc tab (xforms)
> 
> That will put set the linelength for each paragraph.
> 
> If you really want a file with no line breaks, use sed. Eg
> 
> sed ':loop
> $!{
> N
> s/\n/ /
> tloop
> }' your_file.txt > a_file_with_a_single_really_long_line.txt
> 
> Of course, this assumes that you are using an OS that has sed (-;
> 
(Continue reading)

Jose' Matos | 13 Oct 2003 09:23
Picon
Favicon

Re: ascii output

On Friday 10 October 2003 22:07, Antony Templier wrote:
> Angus Leeming wrote:
> > Templier Antony wrote:
> >>Hi,
> >>
> >>Is there is a way to produce ascii file with no limit to lenght of
> >>line for each bloc text ?
> >
> > Add this to your .lyx/preferences file. (If the file doesn't exist,
> > create a new one.)
> >
> > \ascii_linelen your_length

  This is the trick, choose some huge value, say 10000 (if you have paragraphs 
with more than 10000 characters then you should reconsider your writing style 
;-)).

  Using this absurd value will ensure that in pratice no paragraph will wrap. 
I tried and it works, I have been able to reproduce your second case.

> > Alternatively, use the Preferences dialog (Edit->Preferences) and the
> > Outputs->ASCII pane (Qt) or Outputs->Misc tab (xforms)
> >
> > That will put set the linelength for each paragraph.

  This will not work, at least in the qt case as the maximum value allowed is 
120.
  So I advise you to change this value by hand.

> > If you really want a file with no line breaks, use sed. Eg
(Continue reading)

John Levon | 13 Oct 2003 17:41
Favicon

Re: ascii output

On Mon, Oct 13, 2003 at 08:23:24AM +0100, Jose' Matos wrote:

>   This is the trick, choose some huge value, say 10000 (if you have paragraphs 
> with more than 10000 characters then you should reconsider your writing style 
> ;-)).

>   This will not work, at least in the qt case as the maximum value allowed is 
> 120.

This restriction should be removed.

john

--

-- 
Khendon's Law:
If the same point is made twice by the same person, the thread is over.

Angus Leeming | 13 Oct 2003 18:53
Favicon

Re: ascii output

John Levon wrote:

> On Mon, Oct 13, 2003 at 08:23:24AM +0100, Jose' Matos wrote:
> 
>>   This is the trick, choose some huge value, say 10000 (if you have
>>   paragraphs
>> with more than 10000 characters then you should reconsider your
>> writing style ;-)).
> 
>>   This will not work, at least in the qt case as the maximum value
>>   allowed is
>> 120.
> 
> This restriction should be removed.

I've found the file
        designer2 ui/QPrefAsciiModule.ui
I've found the maxValue thingy, set to 120. How do I remove the 
restriction? Set it to -1?

--

-- 
Angus

John Levon | 13 Oct 2003 18:35
Favicon

Re: ascii output

On Mon, Oct 13, 2003 at 04:53:11PM +0000, Angus Leeming wrote:

> I've found the file
>         designer2 ui/QPrefAsciiModule.ui
> I've found the maxValue thingy, set to 120. How do I remove the 
> restriction? Set it to -1?

I dunno, to be honest

john

--

-- 
Khendon's Law:
If the same point is made twice by the same person, the thread is over.

Angus Leeming | 14 Oct 2003 00:05
Favicon

Re: ascii output

John Levon wrote:
>> I've found the file
>>         designer2 ui/QPrefAsciiModule.ui
>> I've found the maxValue thingy, set to 120. How do I remove the
>> restriction? Set it to -1?
> I dunno, to be honest

I looked at the Qt source: can't be done. Choose a different widget.

--

-- 
Angus

Angus Leeming | 11 Oct 2003 01:40
Favicon

Re: ascii output

Antony Templier wrote:
> Thank you for answer. (I appreciate your useful sed loop ;-)
> 
> But i guess my question wasn't well expressed. I'm not a great
> english spoken man, so i joined a little sample of what i would. (cf
> attaced file) I don't found a way to do that with Lyx but it would
> be very useful to export into scribus for exemple (i 'm grafic
> designer). Is the best way to make a bash script, lyx files to
> well_done_ascii_as_i_want ?

Bonsoir, Antony. Ton anglais est meuiller que mon français ;-)

Est-ce que tu voudrais tous les mots de chaque paragraphe sur une 
ligne single? Alors je pense que ce sera suffisant d'avoir une entrée
        \ascii_linelen 10000
dans le fichier ~/.lyx/preferences. 

Peut-être ce script t'aideras

sed ':loop
/^ *$/!{
$!{
N
/\n *$/!{
s/\n/ /
tloop
}
}
}' ton_fichier > le_fichier_parfait

(Continue reading)

Antony Templier | 12 Oct 2003 00:48
Picon

Re: ascii output

Angus Leeming wrote:
> Antony Templier wrote:
> 
>>Thank you for answer. (I appreciate your useful sed loop ;-)
>>
>>But i guess my question wasn't well expressed. I'm not a great
>>english spoken man, so i joined a little sample of what i would. (cf
>>attaced file) I don't found a way to do that with Lyx but it would
>>be very useful to export into scribus for exemple (i 'm grafic
>>designer). Is the best way to make a bash script, lyx files to
>>well_done_ascii_as_i_want ?
> 
> 
> Bonsoir, Antony. Ton anglais est meuiller que mon français ;-)
> 
> Est-ce que tu voudrais tous les mots de chaque paragraphe sur une 
> ligne single? Alors je pense que ce sera suffisant d'avoir une entrée
>         \ascii_linelen 10000
> dans le fichier ~/.lyx/preferences. 
> 
> Peut-être ce script t'aideras
> 
> sed ':loop
> /^ *$/!{
> $!{
> N
> /\n *$/!{
> s/\n/ /
> tloop
> }
(Continue reading)


Gmane