Re: newline separated grep output



On 9/22/2008 4:36 AM, chrisbgp@xxxxxxxxx wrote:
Hello,

I'm trying to filter a string so that I can sort it. The problem is
that these strings appear after each other and I can't use cut/sort
that way.

Example:
newArray(329,30,11,7255,0,7255,77,26137444,11269,'GD','test','test',
83246,'test',
211300,365465,13206,108,17312303,143,3232130,45,6224111,0);\x0d\x0a\x0d
\x0aaP[12]

I would like the have the results to be separated by newline so I can
use 'cut' and 'sort'. I only need "329,30,11,7255". I don't know if
grep is able to do that, haven't found anything in the manpage. Maybe
there is an easier way?

Sorry, but the above could mean a few different things, and it's not clear if
the "Example" you posted is a single record or 2 records and whether or not
line-wrapping in your newsreader is occuring. You might want to provide a small
set of sample input (with no line wrapping) and the expected output for that input.

Ed.

.



Relevant Pages

  • Re: VB6 LISTBOX problem
    ... Have a look at the code below, can you do a sort that is faster ... There are of course all sorts of ways of sorting stuff, especially stuf that is "linked together" as in your UDTs, but to prove the following code sorts it in exactly the same way that your own original code does so, by concatenating all three items of each element into a composite string exactly as you are already doing, but instead of dumping those composite strings into a ListBox it dumps them into a VB string array. ... Private Type SAFEARRAY1D ... Dim StPtr As Long, VAs String, pVAs Long ...
    (microsoft.public.vb.general.discussion)
  • Re: need help sorting text by trailing Numbers Value
    ... You can try the following VBA code and see if it works to give you a sort string you can use. ... Dim strReturn As String ... Then in the next step how could i move all of the trailing Numerical charachters to a new field? ...
    (microsoft.public.access.reports)
  • Re: Sort Type
    ... Like I said, the Space$ function itself it is about 50 per cent faster than the equivalent String$ function, but the main speed improvement will come from minimizing the number of times you call your Normalize function by taking it out of the sort routine itself. ... I can't really comment further on your normalize function since you have not provided a comprehensive sample of the stuff you intend to sort but, whatever function you end up using, my own previous suggestion of normalizing your strings into a temporary array just once and then performing your ShuttleMerge Index Sort on the temporary array will still produce a massive speed increase regardless of what you end up with in your Normalize function. ...
    (microsoft.public.vb.general.discussion)
  • C Sharp sorting considered superior to C by an order of magnitude
    ... following sort algorithms and the following points. ... its own comparision for the types bool, byte, short, int, long, ... single, double and string. ... private CheckBox CHKdeterminism; ...
    (comp.programming)
  • Re: Cant Figure Out How To Sort On Bind
    ... The sort order is not being passed as an argument, ... with the string "searchCache" to create a key for it, ... 'Assign ColumnOrder to ViewState ... Sub GetDataReader(ByVal ColumnOrder As String) ...
    (microsoft.public.dotnet.framework.aspnet)