Author Topic: Requesting Ability to Transpose Lines  (Read 249 times)

Offline Arthur

  • Hero Member
  • *****
  • Posts: 624
  • Karma: +1/-0
  • He who is ashamed of asking is afraid of learning.
    • View Profile
    • My Blog
Requesting Ability to Transpose Lines
« on: August 24, 2011, 11:17:57 pm »
I guess this topic will stay within the feature suggestions  :), OK, now to the point:
I have been recently tasked with migrating a large number of text files returned from a proprietary database to SQL Server.
Oftentimes the files contain table headers e.g. ABC1 ABC2 XYZ1 XYZ2 and so forth; I would like to transpose (an Excelish expression meaning line to columns) these lines into columns so the above would become
ABC1
ABC2
XYZ1
XYZ2
(then I hope to the macro in the HE alpha would add the commas), the # of fields is a catastrophe, thus I think it would be nice to have HE being able convert lines to columns. Right now I can do that in Excel, but have formatting issues, besides, I not aware of  any other text editor or IDE that would be able to do this.

Online alex

  • Developer
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1712
  • Karma: +29/-2
    • View Profile
    • HippoEDIT
Re: Requesting Ability to Transpose Lines
« Reply #1 on: August 25, 2011, 02:52:08 am »
Hi Arthur,

this is very big request. Do not know, if this should be really implemented in programmers text editor...
The problem here s not only to transpose columns to lines, but to first recognize columns (maybe have special mode for editing in columns) and only then give possibility to transpose.
So, I will keep this in ideas list, but do not know, when and if this will be implemented.

But one of the editors, which has something similar, and where transpose can be implemented easier is emeditor. I have seen new, column editing mode in last versions.

BR, Alex

Offline Stefan

  • Administrator
  • Hero Member
  • *****
  • Posts: 774
  • Karma: +6/-0
    • View Profile
Re: Requesting Ability to Transpose Lines
« Reply #2 on: August 25, 2011, 02:14:09 pm »
convert lines to columns

e.g. ABC1 ABC2 XYZ1 XYZ2 and so forth;

to transpose these lines into columns
ABC1
ABC2
XYZ1
XYZ2
(then add the commas),

Do i misunderstand this request
or couldn't that be done by

Code: [Select]
For Each Line In LineS Do
   ColumnsArray = split(Line, " ")
    For x = 0 To UBount(ColumnsArray)
         OutArray = OutArray & ColumnsArray(x) & "," & vbCRLF
    Next Column
Next Line

This would provide for lines like:
ABC1 ABC2 XYZ1 XYZ2
One1 Two2 Thre Four4

that output:
ABC1,
ABC2,
XYZ1,
XYZ2,
One1,
Two2,
Thre,
Four4,


Also, once we are able to replace selected text by an output from an tool, we can use SED or AWK for such tasks.

Offline Arthur

  • Hero Member
  • *****
  • Posts: 624
  • Karma: +1/-0
  • He who is ashamed of asking is afraid of learning.
    • View Profile
    • My Blog
Re: Requesting Ability to Transpose Lines
« Reply #3 on: August 26, 2011, 12:38:54 am »
Hi Stefan,
cool, thanks, yeah, coding this out is the way to go, also thinking that it is what I would use in the scripting engine of HE :-)
As an aside, AWK or SED are not normally "found" on Windows machines.

 

Related Topics

  Subject / Started by Replies Last post
6 Replies
1002 Views
Last post May 22, 2011, 04:30:14 pm
by Stefan
1 Replies
740 Views
Last post January 19, 2009, 02:50:43 pm
by alex
1 Replies
439 Views
Last post February 17, 2009, 08:09:58 am
by JJK
2 Replies
519 Views
Last post February 20, 2009, 03:59:10 pm
by Arthur
4 Replies
629 Views
Last post April 24, 2009, 03:50:23 pm
by alex