Jump to content
Kfollow

Metoda de separare notepad++ - csv sau exel

Recommended Posts

Salut,

Am o lista de 70.000 contacte ( nu e-mail ) si vreau sa stiu daca se cunoaste o metoda de separare.

Adica: Eu in momentul de fata din 100 in 100 fac copy/paste si mut intr-o alta lista. Se poate face cumva acest lucru automat?  Folosesc notepad++ si csv

Link to comment
Share on other sites

Din lista de 70.000 de texte daca se pot extrage liste din 100 in 100 de texte. - Ele sunt unele sub altele pana la numarul de 70.000.

In momentul de fata fac munca manuala le copiez pana la numarul 100 si le mut intr-un alt fisier si tot asa.

Se poate automatiza acest proces?

Link to comment
Share on other sites

  • Active Members
1 hour ago, Kfollow said:

Din lista de 70.000 de texte daca se pot extrage liste din 100 in 100 de texte. - Ele sunt unele sub altele pana la numarul de 70.000.

In momentul de fata fac munca manuala le copiez pana la numarul 100 si le mut intr-un alt fisier si tot asa.

Se poate automatiza acest proces?

Grep

  • Downvote 1
Link to comment
Share on other sites

14 hours ago, Kfollow said:

Din lista de 70.000 de texte daca se pot extrage liste din 100 in 100 de texte. - Ele sunt unele sub altele pana la numarul de 70.000.

In momentul de fata fac munca manuala le copiez pana la numarul 100 si le mut intr-un alt fisier si tot asa.

Se poate automatiza acest proces?

 

Sunt mai multe metode pentru a obtine ce vrei insa probabil cel mai usor pentru tine e urmatoarea:

 

1. Salvezi fisierul cu 70000 rows intr-un folder anume - aka nu-l pastra pe desktop caci iti va umple ecranul metoda urmatoare cu fisiere cu datele

2. Deschizi fisierul cu Excel si prima oara imparti workbook-ul in worksheets a cate 100 rows fiecare astfel:

  • Bagi ALT+F11 sa pornesti VBA
  • Insert > Module
  • Dai paste la urmatoarele:

 Sub SplitData()
'Updateby20140617
Dim WorkRng As Range
Dim xRow As Range
Dim SplitRow As Integer
Dim xWs As Worksheet
On Error Resume Next
xTitleId = "Split rows into worksheets"
Set WorkRng = Application.Selection
Set WorkRng = Application.InputBox("Range", xTitleId, WorkRng.Address, Type:=8)
SplitRow = Application.InputBox("Split Row Num", xTitleId, 100, Type:=1)
Set xWs = WorkRng.Parent
Set xRow = WorkRng.Rows(1)
Application.ScreenUpdating = False
For i = 1 To WorkRng.Rows.Count Step SplitRow
    resizeCount = SplitRow
    If (WorkRng.Rows.Count - xRow.Row + 1) < SplitRow Then resizeCount = WorkRng.Rows.Count - xRow.Row + 1
    xRow.Resize(resizeCount).Copy
    Application.Worksheets.Add after:=Application.Worksheets(Application.Worksheets.Count)
    Application.ActiveSheet.Range("A1").PasteSpecial
    Set xRow = xRow.Offset(SplitRow)
Next
Application.CutCopyMode = False
Application.ScreenUpdating = True
End Sub

  • Dai F5 sa rulezi.
  • Vei primi un pop-up care te intreaba range-ul care sa il foloseasca. Bagi in format "$A$1:$P70000" sau ce range vrei tu sa cuprinda si apoi OK

 

Acum vei avea worksheet-uri a cate 100 rows fiecare. Iar acum pasul al 2-lea sa dai export la toate worksheet-urile sa fie salvate in fisiere diferite fiecare:

1. Bagi iarasi ALT+F11 sa pornesti VBA

2. Insert > Module

3. Dai paste la urmatoarele:


Sub Splitbook()
'Updateby20140612
Dim xPath As String
xPath = Application.ActiveWorkbook.Path
Application.ScreenUpdating = False
Application.DisplayAlerts = False
For Each xWs In ThisWorkbook.Sheets
    xWs.Copy
    Application.ActiveWorkbook.SaveAs Filename:=xPath & "\" & xWs.Name & ".xlsx"
    Application.ActiveWorkbook.Close False
Next
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End Sub

4. Bagi F5 sa ruleze. Va dura putin, in functie de volumul de worksheet-uri (banuiesc ca 70000/100 deci 700 fisiere) insa nu ar trebui sa dureze foarte mult, depinde de PC tau

 

 

  • Like 1
  • Upvote 5
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...