Forum Discussion
CPSR13
Apr 28, 2020Copper Contributor
Grouped text conversion to columns in Excel
I have report data in notepad .txt format that is grouped by employee. I need to convert to columns in an Excel spreadsheet. There are 12477 lines...is there a way to do it without having to perform text to columns, transpose, copy/paste, across the sheet for all 1000+ employees?
AKuma0411 I'm not sure how well this will perform with a larger dataset, but you can give it a try anyways...
=LET( ucn, A2:A16, type, C2:C16, platform, E2:E16, start, F2:F16, end, G2:G16, months, Sales!E1:P1, data, Sales!E2:P10, ucns, Sales!A2:A10, platforms, Sales!C2:C10, MAP(ucn, type, platform, start, end, LAMBDA(u,t,p,s,e, LET( incl1, (months>=s)*(months<=e), incl2, IF(t<>"DSeA", NOT((months>=MINIFS(start, ucn, u, type, "DSeA", platform, p))*(months<=MAXIFS(end, ucn, u, type, "DSeA", platform, p)))*incl1, incl1), incl3, IF(t="SV", NOT((months>=MINIFS(start, ucn, u, type, "SCC", platform, p))*(months<=MAXIFS(end, ucn, u, type, "SCC", platform, p)))*incl2, incl2), IFERROR(SUM(FILTER(FILTER(data, (ucns=u)*(platforms=p)), incl3, 0)), 0)))) )
MAP Function
If there's too much of a lag when applied to a larger dataset, try the second workbook (see attached), which generates a report based on the selected range of UCN's (but keep the range to a reasonable number... if too many are selected, it will also perform poorly).
Note: these will only work with Excel for MS365 or Excel for the Web.
20 Replies
Sort By
- Khizar_HayatBrass Contributor
if you share your sample file on notepad format i can import in excel and tell you a possible measure but sample measure is required
- CPSR13Copper ContributorSomeone was able to use IF, sumifs formulas & pivot tables to convert the data for me. I appreciate your reply!
- Khizar_HayatBrass Contributoroho my friend, it is a jpeg file you have to share a text file so i may be converted your date use advanced filter format but the requirement is text file
you can simply copy and paste the text in msg if you dont have a file
Hurry up!, i am waiting
- CPSR13Copper Contributor
Attached! I wasn't able to pull into individual columns, but am grateful for another set of eyes! Khizar_Hayat
- mathetesSilver Contributor
I'm not @Khizar_Hayyat but think he'll come back to you with a renewed request for an actual text file. What you sent is in a Word document, but actually just contains an image of your text file embedded in a word doc; it is neither editable nor amenable to parsing into separate characters. So at best there'd still be a need to use OCR to get it to text. Make it easier for @Khizar_Hayyat by uploading the actual text--and yes, turn the names into fictitious ones first.
For myself, back to the question of the source being available in CSV instead of text, it's hard to imagine a service provider not being willing to do that service. (Although I will acknowledge having been frustrated when Apple first released their charge card, in conjunction with Goldman, that they provided monthly statements only in PDF form. It took months before they rectified what should never have happened in the first place.)
- DhaniColeBrass Contributor
You can do this with Power Query (under data tab, "From Text/CSV").
If you provide an example of the text document (as .txt), I can see if I can figure it out.
- mathetesSilver Contributor
Possibly.
Much will depend on the level of consistency of how the data are organized.
Your description doesn't give enough details, however. Is it possible to post a few representative sets of the textual data, after first changing any personal data so that no real person can be identified.
- mathetesSilver Contributor
My, oh, my, what a mess. I'm retired now, but had a long career in HR, and for some of that time was director of the HR and Payroll database for a major corporation. So I recognize these fields.
Just out of curiosity, is it possible to go back to the source of that text file--which pretty obviously was a database of some kind--and get it delivered as a CSV file (as it should have been in the first place)?
I'm sure it would be possible to write some kind of routine that could go through this text file and parse it into its many fields, but there's not a consistent set of columns (it's finite, but varies from person to person).......so it would be a stripping routine that would be beyond my abilities.